hash = Hash.new(0) gets.split.map(&:to_i).each{|x| hash[x] += 1 } a = hash.values if a.include?(3) if a.include?(2) puts 'FULL HOUSE' else puts 'THREE CARD' end elsif a.include?(2) if a.count(2) == 2 puts 'TWO PAIR' else puts 'ONE PAIR' end else puts 'NO PAIR' end