One of the examples has a remark: "The node with value 5 and the node with value 6 have the same position according to the given scheme.
However, in the report "[1,5,6]", the node value of 5 comes first since 5 is smaller than 6."
But my Go solution fails on the following test:
Input:
[0,5,1,9,null,2,null,null,null,null,3,4,8,6,null,null,null,7]
Output:
[[7,9],[5,6],[0,2,4],[1,3],[8]]
Expected:
[[9,7],[5,6],[0,2,4],[1,3],[8]]Why in this case 9 should go before 7 in the first array?