Coding for interviews 8 queens problem