1. 程式人生 > >LeetCode刷題Medium篇Palindrome Partitioning

LeetCode刷題Medium篇Palindrome Partitioning

題目

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:
[
  ["aa","b"],
  ["a","a","b"]
]

十分鐘嘗試