Guest User

Untitled

a guest
Feb 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. class Solution:
  2. def numJewelsInStones(self, J, S):
  3. """
  4. :type J: str
  5. :type S: str
  6. :rtype: int
  7. """
  8. s = set(c for c in J)
  9.  
  10. return len(list(filter(lambda x: x in s, S)))
Add Comment
Please, Sign In to add comment