12345678910111213 |
- class Solution:
- def numJewelsInStones(self, J: str, S: str) -> int:
- total = 0
- for jewel in J:
- for stone in S:
- if stone == jewel:
- total += 1
-
- return total
-
- s = Solution()
- print("Expected: 3")
- print("Got:", s.numJewelsInStones("abcD", "DaaFz"))
|