Cut into palindromes
Write palindrome_cuts(text) that returns every way to cut text into pieces that are
each a palindrome, as a list of lists of strings. Order of the output does not matter.
palindrome_cuts("aab") -> [["a", "a", "b"], ["aa", "b"]]
palindrome_cuts("a") -> [["a"]]
The point is to practise backtracking over cut positions, pruning any prefix that is not a palindrome.
def palindrome_cuts(text):
...