Premium problem77. Negate Float Array In Place

Hard Locked

Change the sign of every element of the float array Z in place (write the negated values back into the same underlying buffer rather than allocating a new array). Return the result.

Input

[-1.   -0.75 -0.5  -0.25  0.    0.25  0.5   0.75  1.  ]

Output

[ 1.    0.75  0.5   0.25 -0.   -0.25 -0.5  -0.75 -1.  ]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)