Premium problem85. Make a Matrix Symmetric

Hard Locked

Given a square matrix Z, return a symmetric matrix S = Z + Zᵀ - diag(Z) (so S[i,j] == S[j,i]).

Input

[[0 1 2]
 [3 4 5]
 [6 7 8]]

Output

[[ 0  4  8]
 [ 4  4 12]
 [ 8 12  8]]

Premium problem

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

Implement solve(...)