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;
}
};
Code Example |
---|
Cpp :: Call db.close() on Button_Click (QT/C++) |
Cpp :: c++ compile to msi |
Cpp :: irremoteesp8266 example |
Cpp :: declare a structer in cpp |
Cpp :: print all chrchetrs of a string c++ |
Cpp :: c++ create vector of size |
Cpp :: min stack |
Cpp :: what is c++ function |
Cpp :: random c++ |
Cpp :: main function |
Cpp :: stack in c++ |
Cpp :: c++ permutation |
Cpp :: c++ quicksort |
Cpp :: swap first and last character of string in c++ |
Cpp :: vector erase iterator |
Cpp :: 2927260.eps 2927262.jpg 2927263.ai License free.txt License premium.txt |
C :: c colour text |
C :: calculate distance between 2 points X Y axis |
C :: Sorting number excluding elements in highest to lowest |
C :: C overwrite last line |
C :: rl_replace_line |
C :: see if two strings are equal in C |
C :: reattach screen linux |
C :: remove first character from string c |
C :: how to sleep in c |
C :: how to checkout branch from commit id |
C :: c syntax |
C :: c int |
C :: count distinct characters in a string C |
C :: c read file content |