Skip to content

Commit 40f1ef0

Browse files
authored
Create 0771 - Solution.py
1 parent ed82802 commit 40f1ef0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
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)