Skip to content

Commit 37f520b

Browse files
authored
Create Count Prefixes of a Given String.java
1 parent 1465f40 commit 37f520b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution {
2+
public int countPrefixes(String[] words, String s) {
3+
return (int) Arrays.stream(words).filter(word -> s.startsWith(word)).count();
4+
}
5+
}

0 commit comments

Comments
 (0)