import java.util.*; public class Solution { public ArrayList<String> wordBreak(String s, Set<String> dict) { ArrayList<String> list = new ArrayList<>(); dfs(s, s.length(), "", dict, list); return list; } /** * index 末尾索引 */ ...