题目描述
给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。
返回 s 所有可能的分割方案。
样例
输入: "aab"
输出:
[
["aa","b"],
["a","a","b"]
]
算法
dfs + 剪枝
在回文判断中预先打表
Java 代码
class Solution {
List<List<String>> ans = new ArrayList<>();
List<String> part = new ArrayList<>();
String s;
int len;
boolean[][] f;
public List