131. Palindrome Partitioning Medium
1/**
2 * [131] Palindrome Partitioning
3 *
4 * Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
5 * A palindrome string is a string that reads the same backward as forward.
6 *
7 * Example 1:
8 * Input: s = "aab"
9 * Output: [["a","a","b"],["aa","b"]]
10 * Example 2:
11 * Input: s = "a"
12 * Output: [["a"]]
13 *
14 * Constraints:
15 *
16 * 1 <= s.length <= 16
17 * s contains only lowercase English letters.
18 *
19 */
20pub struct Solution {}
21
22// problem: https://leetcode.com/problems/palindrome-partitioning/
23// discuss: https://leetcode.com/problems/palindrome-partitioning/discuss/?currentPage=1&orderBy=most_votes&query=
24
25// submission codes start here
26
27impl Solution {
28 pub fn partition(s: String) -> Vec<Vec<String>> {
29 vec![]
30 }
31}
32
33// submission codes end
34
35#[cfg(test)]
36mod tests {
37 use super::*;
38
39 #[test]
40 fn test_131() {
41 }
42}
43
Back
© 2025 bowen.ge All Rights Reserved.