func countJewels(s, j) { s.chars.count { |c| j.contains(c) } } say countJewels("aAAbbbb", "aA") #=> 3 say countJewels("ZZ", "z") #=> 0
Last updated 3 years ago