Premium problem53. Float32 to Int32 In Place

Medium Locked

Z is a float32 array. Reinterpret its underlying memory as int32 in place (without allocating a new array), overwriting that memory so it holds the truncated integer value of each original float. Return the resulting int32 array.

Input

[1.5 2.7 3.2 9.9]

Output

[1 2 3 9]

Premium problem

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

Implement solve(...)