Amazon Interview Question

Eight queen puzzle