| 1 | |
| 2 | class Solution { |
| 3 | public int numJewelsInStones(String J, String S) { |
| 4 | Set<Character> Jset = new HashSet(); |
| 5 | for (char j: J.toCharArray()) |
| 6 | Jset.add(j); |
| 7 | |
| 8 | int ans = 0; |
| 9 | for (char s: S.toCharArray()) |
| 10 | if (Jset.contains(s)) |
| 11 | ans++; |
| 12 | return ans; |
| 13 | } |
| 14 | } |
nothing calls this directly
no outgoing calls
no test coverage detected