leetcode 算法题 (python),从易到难,发到博客,促进自己坚持刷题!
class Solution:
def numJewelsInStones(self, J, S):
"""
:type J: str
:type S: str
:rtype: int
"""
time = 0
for i in J:
for k in S:
if i is k:
time+=1
return time
leetcode 算法题 (python),从易到难,发到博客,促进自己坚持刷题!
class Solution:
def numJewelsInStones(self, J, S):
"""
:type J: str
:type S: str
:rtype: int
"""
time = 0
for i in J:
for k in S:
if i is k:
time+=1
return time