Japt, 34 bytes
ó¥ k_l vîò k_l É}Ãc
ó¥ l ¥Ul ?U:ß
Recursively removes pairs of equal numbers until none exist.
Try it online! with the -Q
flag to format the output array.
Run all test cases using my WIP CodePen.
ó¥ k_l vîò k_l É}Ãc
ó¥ l ¥Ul ?U:ß
Recursively removes pairs of equal numbers until none exist.
Try it online! with the -Q
flag to format the output array.
Run all test cases using my WIP CodePen.