True Square in a Binary Matrix

  • + 1 comment

    For this case:

    4
    1 0 0 1
    0 1 1 0
    0 0 0 0
    0 0 0 0
    

    We can exchange the top left 1*2 rectangle with top right 1*2 rectangle and get a 2*2 square.

    But the answer of author's code is 1.