Initial working version of Queens problem (problem 9.9) from CTCI.