question: private void validate ( int [ ] [ ] b ) { int found [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; StringBuilder bs = new StringBuilder ( ) ; for ( int r = 0 ; r <= MaxR ; r ++ ) { for ( int c = 0 ; c <= MaxC ; c ++ ) { found [ b [ r ] [ c ] ] = 1 ; bs . append ( b [ r ] [ c ] ) ; } bs . append ( '|' ) ; } for ( int i = 0 ; i < found . length ; i ++ ) { if ( found [ i ] == 0 ) { throw new IllegalArgumentException ( "Illegal board state:" + bs ) ; } } }
target:  Validate the given board state. 