From ab0fe6f86bd56a054ba997972193c785faa61652 Mon Sep 17 00:00:00 2001 From: simonecorbo99 <53407230+simonecorbo99@users.noreply.github.com> Date: Sat, 31 Oct 2020 12:37:15 +0100 Subject: [PATCH 1/2] Create Solution#771.py --- Python3/Solution#771.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Python3/Solution#771.py 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 + From 1e7150dafe337455616b2aea7a2cf2ffaf02cfd5 Mon Sep 17 00:00:00 2001 From: simonecorbo99 <53407230+simonecorbo99@users.noreply.github.com> Date: Sat, 31 Oct 2020 12:45:50 +0100 Subject: [PATCH 2/2] Update Contributors.md --- Contributors.md | 2 ++ 1 file changed, 2 insertions(+) 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) +