| 1 | class Solution { |
| 2 | public: |
| 3 | int numJewelsInStones(string J, string S) { |
| 4 | int count = 0; // taking the count of stones that are jewels |
| 5 | for(int i=0;i<J.size();i++){ // traversing over the types of jewels string |
| 6 | for(int j=0;j<S.size();j++){ // traversing over the type of stones given string and comparing if a jewel is present |
| 7 | if(J[i] == S[j]){ |
| 8 | count++; // incrementing the count if jewel is found |
| 9 | } |
| 10 | } |
| 11 | } |
| 12 | return count; |
| 13 | } |
| 14 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected