cards = [*1..13] N = gets.split.map(&:to_i) match_count = [] cards.each do |card| match_count[card] = N.count(card) end match_count.compact! if match_count.include?(3) if match_count.include?(2) print 'FULL HOUSE' else print 'THREE CARD' end elsif match_count.include?(2) if match_count.count(2) == 2 print 'TWO PAIR' else print 'ONE PAIR' end else print 'NO HAND' end