Absolute Permutation Hackerrank Solution C