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