How did you solve CUBVIRUS (Cubical Virus) in December Long Challenge 2019?

I see a lot of people got 50+ points on this problem, while I could not even score 5 points. Can you please share your approach for the problem.


I got 77 points in last question , first i made a function which calculates the living cell after virus, then i made functions which sort xy,yz,zx planes according to the continuous zeroes is them (means less infection plane comes first) but the problem is that when u sort yz or zx planes then u have to assume that xy planes are already sorted. U can see that
If u change the order of sorting answer will always change therefore i use infinite while loop which executes sorting in all 3 direction the loop will break when saturation point comes
Ideally answer should not change if change order of sorting i am also waiting for its editorial.

1 Like