Absolute Permutation Hackerrank Solution In Java