exercise 2.42 n-queens