Solution for N Queens