I am stuck on this following problem:
Given a string of size n, for each i from 1 to n you need to find if the string can be split into i non-empty non-intersecting palindromes. Output YES/NO.
aabaa(1 palindrome), aa|b|aa(3 palindromes), a|b|a|aa(4 palindromes), a|b|a|a|a(5 palindromes)
Notice that you can not split the string into 2 palindromes.
Thanks for reading the problem. It will be really helpful if you can provide me with a solution.