Solution for N-Queens