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.
No it doesn't --> it's more efficient because it starts with largest string possible and works to smaller strings as necessary if a match is not found.
Worked fine when I tried it...
Woow!what a one liner
This one will indeed timeout..so it is not the solution..
I don't think so. Before I saw this, I think that my solution is a Brute-force))))))
clean - yes, but unfortunately times out after 12 seconds
There is nothing smart there. It goes through every possible substring just like every other solution does. There is no way around there. It just does it in reverse.
I contest that this is a best practice or clever. Run a timer with this function and compare it to the other solutions here to see how awful it is. There are some that run approximately 15 times faster.