LeetCode 771

112 阅读1分钟

leetcode-cn.com/problems/je…

class Solution {
    fun numJewelsInStones(J: String, S: String): Int {
        var cnt = 0
        for (s in S){
            if (s in J){
                cnt += 1
            }
        }
        return cnt
    }
}