We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
So, spoiler/clues alert first.
Okay?
Good.
This one took me a while. Javascript is sloooow at this kind of stuff.
Firstly, test your strings right to left.
Secondly, skip repeats.
There are much more complicated approaches, but this was enough to get through.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Save Humanity
You are viewing a single comment's thread. Return to all comments →
So, spoiler/clues alert first. Okay? Good. This one took me a while. Javascript is sloooow at this kind of stuff. Firstly, test your strings right to left. Secondly, skip repeats. There are much more complicated approaches, but this was enough to get through.