Itertools Permutations Hackerrank Solution For List