Interview question of the issue #289 of rendezvous with cassidoo.
Given a list of numbers, return all groups of repeating consecutive numbers.
Examples:
> repeatedGroups([1, 2, 2, 4, 5])
[[2, 2]]
> repeatedGroups([1, 1, 0, 0, 8, 4, 4, 4, 3, 2, 1, 9, 9])
[[1, 1], [0, 0], [4, 4, 4], [9, 9]]
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!