backtracking of nqueens and trap water