728x90
https://leetcode.com/problems/jewels-and-stones/submissions/1168400707/
class Solution:
def numJewelsInStones(self, jewels: str, stones: str) -> int:
count = 0
for j in jewels[:]:
count += stones.count(j)
return count
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 2610. Convert an Array Into a 2D Array With Conditions (0) | 2024.02.08 |
---|---|
[Leetcode] 1282. Group the People Given the Group Size They Belong To (0) | 2024.02.08 |
[Leetcode] 1512. Number of Good Pairs (0) | 2024.02.07 |
[Leetcode] 2671. Frequency Tracker (0) | 2024.02.07 |
[Leetcode] 2236. Root Equals Sum of Children (0) | 2024.02.05 |