Absolute Permutation Hackerrank Solution In Python