Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. func numJewelsInStones(J string, S string) int {
  2. isJewel := make(map[byte]bool, len(J))
  3. count := 0
  4. for j := range J {
  5. isJewel[J[j]] = true
  6. }
  7.  
  8. for s := range S {
  9. if isJewel[S[s]] {
  10. count ++
  11. }
  12. }
  13. return count
  14. }
Add Comment
Please, Sign In to add comment