Skip to content

Commit 51c4bac

Browse files
refactor 1268
1 parent 29089bb commit 51c4bac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ public List<List<String>> suggestedProducts(String[] products, String searchWord
99
TrieNode root = buildTrie(products);
1010
List<List<String>> result = new ArrayList<>();
1111
for (int i = 1; i <= searchWord.length(); i++) {
12-
String searchTerm = searchWord.substring(0, i);
13-
result.add(findTopThreeMatches(root, searchTerm));
12+
result.add(findTopThreeMatches(root, searchWord.substring(0, i)));
1413
}
1514
return result;
1615
}

0 commit comments

Comments
 (0)