Pergunta de entrevista da empresa Amazon

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