puzzles/repeated-groups/README.md

18 lines
531 B
Markdown
Raw Normal View History

2024-04-02 21:01:09 +00:00
# Repeated groups
Puzzle from the [rendezvous with cassidoo](https://buttondown.email/cassidoo/archive/like-what-you-do-and-then-you-will-do-your-best/) newsletter from February 27th, 2023.
> Given a list of numbers, return all groups of repeating consecutive numbers.
>
> Examples:
>
> ```javascript
> > 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]]
> ```
Solution posted at https://strangeobject.space/@ooze/109937701330608625