Premium problem67. Sum Over Last Two Axes

Hard Locked

Given a 4-D array A, return the sum over its last two axes at once (result has the shape of the first two axes).

Input

A = np.arange(144).reshape(3, 4, 3, 4)

Output

[[  66  210  354  498]
 [ 642  786  930 1074]
 [1218 1362 1506 1650]]

Premium problem

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

Implement solve(...)