question: public int numChildren ( int row ) { int count = 0 ; nextValidRowPositions . clear ( ) ; for ( int i = 0 ; i < n ; i ++ ) { board [ row ] [ i ] = true ; if ( valid ( row , i ) ) { count ++ ; nextValidRowPositions . add ( i ) ; } board [ row ] [ i ] = false ; } return count ; }
target:  Find out how many valid children states are found by trying to add a queen to the given row. Note: No error checking to ensure you aren't adding a queen to a row which already contains one. Caveat Emptor! Returns a number from 0 to n.