8000 update 140 · githubniraj/Leetcode@3dfcbbb · GitHub
[go: up one dir, main page]

Skip to content

Commit 3dfcbbb

Browse files
update 140
1 parent 6eaf1fa commit 3dfcbbb

File tree

1 file changed

+3
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+3
-2
lines changed

src/main/java/com/fishercoder/solutions/_140.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
import java.util.ArrayList;
44
import java.util.HashMap;
55
import java.util.List;
6+
import java.util.Map;
67

78
public class _140 {
89
public static class Solution1 {
910
public List<String> wordBreak(String s, List<String> wordDict) {
1011
return dfs(s, wordDict, new HashMap<>());
1112
}
1213

13-
List<String> dfs(String s, List<String> wordDict, HashMap<String, List<String>> map) {
14+
List<String> dfs(String s, List<String> wordDict, Map<String, List<String>> map) {
1415
if (map.containsKey(s)) {
1516
return map.get(s);
1617
}
1718

18-
ArrayList<String> result = new ArrayList<>();
19+
List<String> result = new ArrayList<>();
1920
if (s.length() == 0) {
2021
result.add("");
2122
return result;

0 commit comments

Comments
 (0)
0