The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
$$(XA = Y) \implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.
In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
$$\eqalign{
X &= y1^+ + C - C11^+ \cr
}$$
For a real vector, the MP-inverse can be written in terms of the transpose
$$a^+ = \frac{a^T}{a^Ta}$$
so we can write
$$1^+ = \tfrac{1}{3}1^T$$
Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
$$\eqalign{
X_{kk} &= e_k^TXe_k \cr
0 &= \tfrac{1}{3}y_k + C_{kk} - \tfrac{1}{3}e_k^TC1 \cr
0 &= y_k + 3C_{kk} - e_k^TC1 \cr
}$$
There are more unknowns than equations, so let's constrain the matrix to $C={\rm Diag}(c).$
$$\eqalign{
0 &= y_k + 3c_{k} - e_k^Tc \cr
c_k &= -\tfrac{1}{2}y_k &\implies
C &= -\tfrac{1}{2}{\rm Diag}(y) \cr
}$$
Putting it all together, and generalizing the dimensions from $(3\to n)$ yields
$$\eqalign{
X &= \tfrac{1}{n}y1^T - \tfrac{1}{n-1}{\rm Diag}(y) + \tfrac{1}{n(n-1)}{\rm Diag}(y)11^T \cr
}$$