Simplified the n queens solution a bit, but it is still too slow to pass the large data set (counting the number of solutions for 12 queens).