Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

771. Jewels and Stones leetcode solution in c++

class Solution {
public:
    int numJewelsInStones(string jewels, string stones) {
        int count=0;
        for(int i=0;i<jewels.length();i++)
        {
            for(int j=0;j<stones.length();j++)
            {
                if(jewels[i]==stones[j])
                {
                    count++;
                }
            }
        }
        return count;
    }
};
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Jewels #Stones #leetcode #solution
ADD COMMENT
Topic
Name
3+8 =