LeetCode 771. 宝石与石头

int numJewelsInStones(char * J, char * S){
     
    int count=0;
    char*temp=J;
    for(;*S!='\0';S++)
    {
     
        for(;*J!='\0';J++)
        {
     
            if(*S==*J) count++;
        }
        J=temp;
    }
    return count;
}

你可能感兴趣的:(LeetCode,算法,leetcode)