Skip to content

Commit c984cbe

Browse files
Create 771. Jewels and Stones.py
1 parent 97c0517 commit c984cbe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python/easy/771. Jewels and Stones.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def numJewelsInStones(self, jewels: str, stones: str) -> int:
3+
jewels_list = list(jewels)
4+
stones_list = list(stones)
5+
jewel_count = 0
6+
for stone in stones_list:
7+
if stone in jewels_list:
8+
jewel_count += 1
9+
return jewel_count

0 commit comments

Comments
 (0)