This Gist will contain challenges of varying difficulty, involving features that are somewhat specific to 05AB1E, for people to try out. The contents of this will then be added to The 05AB1E Lounge, where they will have their own tab.
- Given a list of integers, return the longest prefix with the maximal mode. In case two or more elements of a prefix occur the maximal number of times, select the highest one. Current record: 7 bytes. Test cases:
[-5, -3, -5, 3, 6, -5] -> [-5, -3] [5, 3, 9, 4, 4, 9, 5, 6, 6, 4] -> [5, 3, 9, 4, 4, 9, 5, 6, 6] [5, 9, 3, 7, 3, 9, 4, 3, 0, 8, 4] -> [5, 9, 3, 7, 3, 9, 4]