Solve the system ax+by=e, cx+dy=f for x and y without calling a linear solver. The six numbers arrive as the list [a, b, c, d, e, f].
Implement solve(coeffs).
Returns. Return [x, y] as a NumPy array. A singular system (determinant 0) has no unique solution and raises ValueError.
Example 1
Input:
solve([2, 1, 1, 3, 5, 7])
Output:
[1.6, 1.8]
Example 2
Input:
solve([1, 2, 2, 4, 3, 6])
Output: Raises ValueError.
No results yet
Run your code to check it against the examples, or submit to run every test.