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.
Exactly what I did! I originally started making it "fancy" like the most liked solution but totally agree that this is more readable and you don't even have to think about what's happening. It's just as efficient as well.
I originally went down a path of testing each letter against each other letter in the array and immediately my head hurt. Then I thought, why not compare each letter against a transformed array in which the letter is taken out, and I remembered I can filter to achieve that. I counted the length of the transformed array which is equal to the number of letters 'l' removed. If more than 1 'l' is removed then obviously it's a duplicate and the parens character for that letter should be changed.
I cleaned this up but can't remove this solution. Saved an extra step in the cleaned up version.