mutate array in-place to get bitwise complement value of elements