Skip to content

Commit a0b9a32

Browse files
add 2185
1 parent 3499e48 commit a0b9a32

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|---------------|--------|-------------|-------------
11+
| 2185 |[Counting Words With a Given Prefix](https://leetcode.com/problems/counting-words-with-a-given-prefix/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2185.java) ||Easy||
1112
| 2182 |[Construct String With Repeat Limit](https://leetcode.com/problems/construct-string-with-repeat-limit/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2182.java) ||Medium||
1213
| 2181 |[Merge Nodes in Between Zeros](https://leetcode.com/problems/merge-nodes-in-between-zeros/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2181.java) ||Medium||
1314
| 2180 |[Count Integers With Even Digit Sum](https://leetcode.com/problems/count-integers-with-even-digit-sum/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2180.java) ||Easy||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2185 {
4+
public static class Solution1 {
5+
public int prefixCount(String[] words, String pref) {
6+
int count = 0;
7+
for (String word : words) {
8+
if (word.startsWith(pref)) {
9+
count++;
10+
}
11+
}
12+
return count;
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)