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.
This comment is hidden because it contains spoiler information about the solution
@Me2loveit2 Unless if there is an n log n algorithm for finding palindromes in substrings, the worst case should always be n^2. You can do a bunch of micro-optimizations that will make it slightly faster, but nothing to change the worst case.
PS: Your solution is very jumbled. Couldn't really be bothered to follow it through to the end to figure out the time complexity. But iterating twice over the string with capture matches to find the center of palindromes is already n^2. Then you go through that list and find the centers inside the original string... Why even match them in the first place, if you are just going to find them again? It would make sense that you would time out because you have a bunch of redundancies that are completely unnecessary.