[nqueens] improve how to check if there is a queen at diagonal