image_2021-11-07_01-01-04.png
27.2 KB
#N771. Jewels and Stones
problem link
#solution
problem link
#solution
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count=0;
for(char j:jewels.toCharArray()){
for(char s:stones.toCharArray()){
if(j==s) count++;
}
}
return count;
}
}