Skip to content

Instantly share code, notes, and snippets.

@blakeprobinson
Created January 17, 2019 19:49
Show Gist options
  • Save blakeprobinson/7a99ff7a524cf9f527c0a261bf57a88a to your computer and use it in GitHub Desktop.
Save blakeprobinson/7a99ff7a524cf9f527c0a261bf57a88a to your computer and use it in GitHub Desktop.
func numJewelsInStones(_ jewels: String, _ stones: String) -> Int {
return stones.drop(while: { !jewels.contains($0)}).count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment