LC-Jewels and Stones
2018-01-29 00:45
309 查看
class Solution(object): def numJewelsInStones(self, J, S): """ :type J: str :type S: str :rtype: int """ count = 0 for i in range(len(J)): if J[i] in S: count +=S.count(J[i]) return count Sol = Solution() print Sol.numJewelsInStones('aA','aAAbbbffff')
0,LC上的新题,非常简单
1,统计字母出现的次数,一个count函数就可以完成
相关文章推荐
- 771. Jewels and Stones。
- codechef Jewels and Stones 题解
- LeetCode之771:Jewels and Stones
- python实现 leetcode 771 jewels and stones
- 【leetcode】771. Jewels and Stones
- codechef Jewels and Stones 题解
- 771. Jewels and Stones
- 771.Jewels and Stones (leetcode)
- LeetCode 771. Jewels and Stones
- 771. Jewels and Stones
- LWC 69: 771. Jewels and Stones
- 771. Jewels and Stones
- 771. Jewels and Stones
- 771. Jewels and Stones
- [Leetcode] 771. Jewels and Stones 解题报告
- LeetCode 开坑纪念-水题771-Jewels and Stones
- 771- Jewels and Stones[C++]
- LeetCode之Jewels and Stones(Kotlin)
- 771. Jewels and Stones
- 【CodeChef】 Chef and Stones