Skip to content

Files

Latest commit

Apr 21, 2025
5ba23b8 · Apr 21, 2025

History

History
67 lines (47 loc) · 1.49 KB

0131-palindrome-partitioning.adoc

File metadata and controls

67 lines (47 loc) · 1.49 KB

131. 分割回文串

给你一个字符串 s,请你将 s 分割成一些子串,使每个子串都是 回文串。返回 s 所有可能的分割方案。

示例 1:

输入:s = "aab"
输出:[["a","a","b"],["aa","b"]]

示例 2:

输入:s = "a"
输出:[["a"]]

提示:

  • 1 <= s.length <= 16

  • s 仅由小写英文字母组成

思路分析

回溯

{image_attr}
{image_attr}
{image_attr}
{image_attr}
一刷
link:{sourcedir}/_0131_PalindromePartitioning.java[role=include]
二刷
link:{sourcedir}/_0131_PalindromePartitioning_2.java[role=include]