Skip to content

Commit d31c2b4

Browse files
add 2255
1 parent a38af62 commit d31c2b4

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+
| 2255 |[Count Prefixes of a Given String](https://leetcode.com/problems/count-prefixes-of-a-given-string/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2255.java) || Easy ||
1112
| 2248 |[Intersection of Multiple Arrays](https://leetcode.com/problems/intersection-of-multiple-arrays/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2248.java) || Easy ||
1213
| 2244 |[Minimum Rounds to Complete All Tasks](https://leetcode.com/problems/minimum-rounds-to-complete-all-tasks/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2244.java) || Medium ||
1314
| 2243 |[Calculate Digit Sum of a String](https://leetcode.com/problems/calculate-digit-sum-of-a-string/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2243.java) || Easy ||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2255 {
4+
public static class Solution1 {
5+
public int countPrefixes(String[] words, String s) {
6+
int count = 0;
7+
for (String word : words) {
8+
if (s.startsWith(word)) {
9+
count++;
10+
}
11+
}
12+
return count;
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)