Skip to content

Commit aafbd72

Browse files
authored
Create Jewels and Stones
1 parent 123a660 commit aafbd72

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Jewels and Stones

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public int numJewelsInStones(String J, String S) {
3+
int count = 0;
4+
for(int i = 0; i<S.length(); i++){
5+
if(J.indexOf(S.charAt(i)+"")>-1){
6+
count++;
7+
}
8+
}
9+
return count;
10+
}
11+
}

0 commit comments

Comments
 (0)