Pergunta de entrevista da empresa Amazon

The coding problem is permutation.