Skip to content

Commit e596049

Browse files
committed
Merge branch 'master' of github.com:doocs/leetcode
2 parents 5a04d39 + 40f1ef0 commit e596049

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Solution:
2+
def numJewelsInStones(self, J, S):
3+
"""
4+
:type J: str
5+
:type S: str
6+
:rtype: int
7+
"""
8+
9+
D = {}
10+
for each in J:
11+
D[each] = 0
12+
13+
Sum = 0
14+
for each in S:
15+
if D.get(each) is not None :
16+
Sum += 1
17+
18+
return Sum

0 commit comments

Comments
 (0)