• + 0 comments

    Ruby

    def migratoryBirds(arr)
      a = arr.tally
      a.max_by { |key, val| [val, -key] }.first
    end