public boolean randomNextBoard(int r){
  int sz=nextValidRowPositions.size();
  if (sz == 0) {
    return false;
  }
  int c=(int)(Math.random() * sz);
  board[r][nextValidRowPositions.get(c)]=true;
  return true;
}

public boolean randomNextBoard ( int r ) { int sz = nextValidRowPositions . size ( ) ; if ( sz == 0 ) { return false ; } int c = ( int ) ( Math . random ( ) * sz ) ; board [ r ] [ nextValidRowPositions . get ( c ) ] = true ; return true ; }
if no board is available then return false .
