yuruotong1 发表于 2018-2-3 23:04:24

1.Jewels and Stones



-------通用解法
class Solution {
public:
    int numJewelsInStones(string J, string S) {
            int i=0;
      int cout=0;
      for(;i<J.length();i++){
            int j=0;
            for(;j<S.length();j++){
                if(J==S){
                  cout++;
                }
            }
      }
      return cout;
    }
};

-------高级用法解析
**** Hidden Message *****
页: [1]
查看完整版本: 1.Jewels and Stones