Premium problem97. Outer Product with einsum

Hard Locked

Using einsum notation, return the outer product of vectors A and B:

  • the result has shape (len(A), len(B))
  • entry [i, j] is A[i] * B[j]

Input

A = [1. 2. 3.]
B = [4. 5.]

Output

[[ 4.  5.]
 [ 8. 10.]
 [12. 15.]]

Premium problem

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

Implement solve(...)