Permutation Game Hackerrank Practice