Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit cdfddb9

Browse files
authored
Merge pull request #544 from rkkksss/0771
Added 771 Jewels ans Stones
2 parents e6b6a29 + 9cb8026 commit cdfddb9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

LeetCode/0771_Jewels_and_Stones.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def numJewelsInStones(self, J: str, S: str) -> int:
3+
stones = Counter(S)
4+
count = 0
5+
for j in J:
6+
if stones and j in stones:
7+
count += stones[j]
8+
return count

0 commit comments

Comments
 (0)