Palindrome Partitioning
Split string s into pieces so every piece is a palindrome; return all such partitions.
Intuition
Choose the first piece, then the rest of the string is the same problem again. At each position try every palindromic prefix, recurse on the remainder, and backtrack. The palindrome check prunes whole subtrees the moment a prefix isn't one.
Approach
Frame as choices at a cut point
From index start, every end where s[start:end+1] is a palindrome is a legal next piece.
Recurse and backtrack
Append the piece, recurse from end+1; when start reaches the end of the string the path is one complete answer. Pop and try the next cut.
Prune early
Non-palindromic prefixes are never extended — the check happens before recursion, keeping the tree small.
Solution & live demo
Edge cases
Every 1-char string is a palindrome → [[c]].
Every cut works — output size grows exponentially; that's inherent to the problem.