Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
If the tests required you to output the full sequential set, then yes, Map is the answer. However, it is overkill here because the kata is greedy, and only asks for a single output variable. So it's enough to simply not update the output variable unless you find a longer sequence.
I haven't really delved too deeply into it, but Map will store the characters in strict order of appearance, while the tests seem to be looking for the order of sequence appearance, which takes more code than is necessary for a greedy algorithm.