Files
cpp-flashcards/org/study_deck_02/dsa/backtracking/0131-palindrome-partitioning.org
T

49 lines
881 B
Org Mode
Raw Normal View History

#+PROPERTY: STUDY_DECK_02
* TODO 0131. Palindrome Partitioning :medium:
:PROPERTIES:
:NEETCODE: [[file:../../roadmap.org::*0131. Palindrome Partitioning][0131. Palindrome Partitioning]]
:END:
Given a string ~s~, partition ~s~ such that every substring of the partition is a *palindrome*. Return /all possible palindrome partitioning of /~s~.
*Example 1:*
#+begin_src
Input: s = "aab"
Output: [["a","a","b"],["aa","b"]]
#+end_src
*Example 2:*
#+begin_src
Input: s = "a"
Output: [["a"]]
#+end_src
*Constraints:*
- ~1 <= s.length <= 16~
- ~s~ contains only lowercase English letters.
** TODO Approach
Write your approach here.
** TODO Python
#+begin_src python
class Solution:
def partition(self, s: str) -> List[List[str]]:
#+end_src
** TODO C++
#+begin_src cpp
class Solution {
public:
vector<vector<string>> partition(string s) {
}
};
#+end_src