Given arrays A of shape (3, 1) and B of shape (1, 3), return their broadcasted sum as a (3, 3) array:
A
(3, 1)
B
(1, 3)
(3, 3)
+
Input
A = [[0] [1] [2]] B = [[0 1 2]]
Output
[[0 1 2] [1 2 3] [2 3 4]]
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)