if an element is at distance more than 2 from its actual position then it is not possible to reach permuted array just by swapping with 2 positions left elements so returning - 1
if ( ( arr [ i ] - 1 ) - i > 2 ) return -1 ; }