37. Block-Sum (k×k blocks)

Hard

Given a 2-D tensor Z of shape (h, w) whose dimensions are each divisible by k, compute the sum of each non-overlapping k×k block. Return the reduced tensor of shape (h/k, w/k).

Implement solve(...)