Pregunta de entrevista de Amazon

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