Absolute Permutation Hackerrank Solution For Loop