Amazon interview question

A problem similar to N-Queens for the coding portion.