class Solution {
public:
int numJewelsInStones(string J, string S) {
map<char, int> tem;
int count = 0;
for (auto i = S.begin(); i != S.end(); i++)
{
tem[*i]++;
}
for (auto j = J.begin(); j != J.end(); j++)
{
count += tem[*j];
}
return count;
}
};
LETCODE 771
猜你喜欢
转载自blog.csdn.net/qq_40742888/article/details/98386877
今日推荐
周排行