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.
I doubt that, you're looking forward in the string for repetitions, but what if there was already a duplicate? Look at moonmen, at the first m, you look forward for another and find it, the same with the first o, but what happens when you reach the second one? There are no more forward, the duplicate is behind. The error message format is expected Actual to equal Expected, the first value is what your function wrongly returns.
The only non-repeated letter there is e, isn't it? The error message means your code returned o instead of e.
потому что они одинаковые)
It's just JSFuck, it's completely valid JS (otherwise it wouldn't have worked as a solution!). Don't worry, I did not actually write this code, just minimised my JS as much as possible then converted to JSFuck.
you must use the spoiler flag when discussing code / solution methods. i added the flag