Skip to content

Commit 4309361

Browse files
update 1804
1 parent 776c69d commit 4309361

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/com/fishercoder/solutions/secondthousand

1 file changed

+1
-1
lines changed

src/main/java/com/fishercoder/solutions/secondthousand/_1804.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public int countWordsStartingWith(String prefix) {
5959
}
6060
node = node.children[c - 'a'];
6161
}
62-
return node.count < 0 ? 0 : node.count;
62+
return Math.max(node.count, 0);
6363
}
6464

6565
public void erase(String word) {

0 commit comments

Comments
 (0)