所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 class Solution: def numJewelsInStones(self, J, S): """ :type J: str :type S: str :rtype: int """ # method one return sum([S.count(i) for i in J]) 所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。