You are viewing a single comment's thread. Return to all comments →
Essentially the same thing in Ruby
puts (1..gets.to_i).map {|_| gets.chomp.chars}.reduce(&:&).count
although I prefer using Set here which makes it two lines:
require 'set' puts (1..gets.to_i).map {|_| Set.new(gets.chomp.chars)}.reduce(&:&).count
Seems like cookies are disabled on this browser, please enable them to open this website
Gemstones
You are viewing a single comment's thread. Return to all comments →
Essentially the same thing in Ruby
although I prefer using Set here which makes it two lines: