Function checks if the boundary of the square consists of 0 's
def isSquareOfZeroes ( r1 , c1 , r2 , c2 ) : NEW_LINE INDENT global matrix NEW_LINE for row in range ( r1 , r2 + 1 ) : NEW_LINE INDENT if ( matrix [ row ] [ c1 ] != 0 or matrix [ row ] [ c2 ] != 0 ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT for col in range ( c1 , c2 + 1 ) : NEW_LINE INDENT if ( matrix [ r1 ] [ col ] != 0 or matrix [ r2 ] [ col ] != 0 ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT return True NEW_LINE DEDENT