IBM interview question

Coding questions from hackerank. two questions based on permutations