Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bd6c961

Browse files
add 771.py
1 parent c1d2b99 commit bd6c961

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎py2/771. Jewels and Stones.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution(object):
2+
def numJewelsInStones(self, J, S):
3+
"""
4+
:type J: str
5+
:type S: str
6+
:rtype: int
7+
"""
8+
jewel_cnt = 0
9+
for j in set(J):
10+
jewel_cnt += S.count(j)
11+
return jewel_cnt

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /