Driver code
public static void main ( String args [ ] ) { int row = 4 , column = 4 ; int matrix [ ] [ ] = { { 1 , 1 , 1 , 1 } , { 1 , 0 , 0 , 0 } , { 1 , 0 , 0 , 0 } , { 1 , 0 , 0 , 0 } } ; int k = 6 ; int ans = maxLengthSquare ( row , column , matrix , k ) ; System . out . println ( ans ) ; } }