You are viewing a single comment's thread. Return to all comments →
If two ID of birds are the same number the smaller ID wins. So the array m must be initialized in descending order.
m
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.
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
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
or
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.