1 static int wing=[]() 2 { 3 std::ios::sync_with_stdio(false); 4 cin.tie(NULL); 5 return 0; 6 }(); 7 8 class Solution 9 { 10 public: 11 int numJewelsInStones(string J, string S) 12 { 13 unordered_set<char> jset(J.begin(),J.end()); 14 int count=0; 15 for(char &c:S) 16 { 17 if(jset.find(c)!=jset.end()) 18 count++; 19 } 20 return count; 21 } 22 };
简单,问题不大