---
# System prepended metadata

title: '[771. Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/)'

---

# [771. Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/)
![](https://i.imgur.com/2A2jyIF.png)
![](https://i.imgur.com/x118B1a.png)


int numJewelsInStones(char * jewels, char * stones){
    int n=0;
    for(int i=0;i<strlen(stones);i++)
    {
        for(int j=0;j<strlen(jewels);j++)
        {
            if(stones[i] == jewels[j])
            {
                n++;
            }
        }
    }
    return n;

}