class Solution { public: int numJewelsInStones(string J, string S) { vector<int> container(256,0); for(char s : S) container[s - '0']++; int count = 0; for(char j : J) count += container[j - '0']; return count; } };