File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .ArrayList ;
4
4
import java .util .HashMap ;
5
5
import java .util .List ;
6
+ import java .util .Map ;
6
7
7
8
public class _140 {
8
9
public static class Solution1 {
9
10
public List <String > wordBreak (String s , List <String > wordDict ) {
10
11
return dfs (s , wordDict , new HashMap <>());
11
12
}
12
13
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 ) {
14
15
if (map .containsKey (s )) {
15
16
return map .get (s );
16
17
}
17
18
18
- ArrayList <String > result = new ArrayList <>();
19
+ List <String > result = new ArrayList <>();
19
20
if (s .length () == 0 ) {
20
21
result .add ("" );
21
22
return result ;
You can’t perform that action at this time.
0 commit comments