Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: “aab” Output:
1 2 3 4
[ ["aa","b"], ["a","a","b"] ]
Solution:
This is a similar backtracking problem. For this kind of question, we’ll use a helper function to help us check every possible sequence meet the requirement or not.