Return the unit vector that points in the same direction as a non-zero vector.
Implement solve(x).
Returns. Return a NumPy array of the same shape with length 1. A zero vector has no direction, so it raises ValueError.
Example 1
Input:
solve([3.0, 4.0])
Output:
[0.6, 0.8]
Example 2
Input:
solve([0.0, 0.0])
Output: Raises ValueError.
No results yet
Run your code to check it against the examples, or submit to run every test.