Given a string, partition it such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of the string.
For example, given the input string "aab"
:
Possible partitions are:
["a", "a", "b"]
["aa", "b"]
Implement a function that takes a string as input and returns a list (or array) of lists (or arrays) of strings, where each inner list represents a valid palindromic partition of the input string. This problem can be naturally solved using a backtracking approach.
Happy coding!
Note: January 16, 2025, is a great day to challenge your problem-solving skills, much like the innovative spirit found in historical breakthroughs on this day!