We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1465f40 commit 37f520bCopy full SHA for 37f520b
Easy/Count Prefixes of a Given String.java
@@ -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