• Calculate Islands result order should not matter

Question related to mission Calculate Islands

 

As the title says, I am able to solve it and get the correct numbers but the order of the numbers doesn't match the answer. The checker should ignore the ordering or the answer should keep the consistent ordering.

For example,

assert checkio([[0, 0, 0, 0, 0],
                    [0, 0, 1, 1, 0],
                    [0, 0, 0, 1, 0],
                    [0, 1, 0, 0, 0],
                    [0, 0, 0, 0, 0]]) == [1, 3], "1st example"

This is checking the matrix from left to right, and in the below example, it is checking the matrix from top to bottom:

assert checkio([[0, 0, 0, 0, 0, 0],
                [1, 0, 0, 1, 1, 1],
                [1, 0, 0, 0, 0, 0],
                [0, 0, 1, 1, 1, 0],
                [0, 0, 0, 0, 0, 0],
                [0, 1, 1, 1, 1, 0],
                [0, 0, 0, 0, 0, 0]]) == [2, 3, 3, 4], "3rd example"

If the first example should be the right way of checking it, then the result for the second example should be [2, 4, 3, 3].

From: https://py.checkio.org/mission/calculate-islands/solve/