def char_count(array) counts = array.map { |e| e.length } counts.reduce(:+) end array = %w{ Free Kevin Mitnick } puts char_count(array)