diff --git a/Contributors.md b/Contributors.md index efcf8ce..fc2fc28 100644 --- a/Contributors.md +++ b/Contributors.md @@ -29,3 +29,5 @@ **Caitlin Genna** --> "CS Computer Science Graduate, Fordham University." --> [caitlingenna](https://github.com/caitlingenna) +**Simone Corbo** --> "Physics student from Italy, Sapienza University" --> [simonecorbo99](https:://github.com/simonecorbo99) + diff --git a/Python3/Solution#771.py b/Python3/Solution#771.py new file mode 100644 index 0000000..cd667c5 --- /dev/null +++ b/Python3/Solution#771.py @@ -0,0 +1,17 @@ +#-------Problem Description------- +# +# You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels. +# +# The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A". +# +# + +class Solution: + def numJewelsInStones(self, J: str, S: str) -> int: + c = 0 + for s in S: + if s in J: + c = c+1 + + return c +