Permutation game | HackerRank