Skip to content

solved #771, Python3 #48

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

17 changes: 17 additions & 0 deletions Python3/Solution#771.py
Original file line number Diff line number Diff line change
@@ -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