118. Palindrome Partitioning

MediumBacktracking

Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitionings of s.

Examples

Input: aab

Output: [["a","a","b"],["aa","b"]]

Explanation: Cut into single letters, or take the palindrome 'aa' then 'b'.

Constraints

  • 1 <= s.length <= 16
  • s contains only lowercase English letters.
Loading...

Run checks all cases above. Submit evaluates all test cases.