Update maxSquareInMatrix