cards = gets.chomp.split.map(&:to_i) uniq_cards = cards.uniq card_count = Array.new uniq_cards.each{ |card| card_count << cards.count(card) } if card_count.include?(3) && card_count.include?(2) puts "FULL HOUSE" elsif card_count.include?(3) puts "THREE CARD" elsif card_count.count(2) == 2 puts "TWO PAIR" elsif card_count.include?(2) puts "ONE PAIR" else puts "NO HAND" end