• + 1 comment

    If two ID of birds are the same number the smaller ID wins. So the array m must be initialized in descending order.

    Of course, you can write

    list(range(4, -1, -1))
    

    or

    list(reversed(range(5)))
    

    If there were many kinds of birds I would have written so. But for this specific case [4, 3, 2, 1, 0] is easier to read.

    I just avoid premature generalization.