Function checks if square with all 0 's in boundary  exists in the matrix
static int squareOfZeroes ( int [ ] [ ] matrix ) { int lastIdx = matrix . length - 1 ; Map < String , Boolean > cache = new HashMap < String , Boolean > ( ) ; return ( hasSquareOfZeroes ( matrix , 0 , 0 , lastIdx , lastIdx , cache ) ) ? 1 : 0 ; }