Absolute Permutation Hackerrank Solution For Python 3