Skip to content

Instantly share code, notes, and snippets.

@mohneesh7
Created October 6, 2024 16:31
Show Gist options
  • Save mohneesh7/c65886d6f2d1fe55b70de533614af2b4 to your computer and use it in GitHub Desktop.
Save mohneesh7/c65886d6f2d1fe55b70de533614af2b4 to your computer and use it in GitHub Desktop.
Solution for Jewels and Stones
class Solution:
def numJewelsInStones(self, jewels: str, stones: str) -> int:
num_jewels = 0
for char in stones:
if char in jewels:
num_jewels += 1
return num_jewels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment