Flip the array at provided index