My logic was to check if the rows are not sorted in non-increasing order. If they are not, I then check whether the 1s present in those rows can be arranged correctly by shifting the balls in the columns. However, this approach doesn't seem to work (WA on TC3), and I'm not sure why.
heres my submission 312868120



