class Solution { List<String> ss = new ArrayList<>(); public List<String> wordBreak(String s, List<String> wordDict) { dfs(s,wordDict,"",0); return ss; } public void dfs(String s, List<String> wordDict, String res, int idx){ ...