Yahoo interview question

N-queens problem