Function checks if square with all 0 's in boundary  exists in the matrix
static int squareOfZeroes ( int [ , ] matrix ) { int lastIdx = matrix . GetLength ( 0 ) - 1 ; Dictionary < string , bool > cache = new Dictionary < string , bool > ( ) ; if ( hasSquareOfZeroes ( matrix , 0 , 0 , lastIdx , lastIdx , cache ) ) { return 1 ; } else { return 0 ; } }