• + 0 comments

    python

    def migratoryBirds(arr):
        max_count = 0
        mostcommontype = -1
        for v in sorted(set(arr), reverse=True):
            count_v = arr.count(v)
            if count_v >= max_count:
                max_count = count_v
                mostcommontype = v
        return mostcommontype