Pergunta de entrevista da empresa Onet

Write algorithm for getting permutations of n element set.