25. Diagonal of a Matrix Product

Medium

Return only the diagonal of A @ B as a 1-D tensor, without materializing the full n×n product matrix.

Implement solve(...)