Permutation Game Hackerrank Log