I am not sure how to find the closes point that lies on the intersection of two planes given by equation: $x+y+z=0$ and $x-y=1$ and is closes to origin of coordinate system.
What I've writen is $A=\begin{bmatrix}1 & 1 & 1\\1 & -1 & 0\end{bmatrix}$, $b=\begin{bmatrix}0\\1\end{bmatrix}$, and tried solving first system $Ax=b$. So I calculated MP-inverse of matrix A. So if I understand correctly matrix $A^+b=\begin{bmatrix}0.5\\-0.5\\0\end{bmatrix}$ is where the two planes intersect. Now I am not sure if this point is also the nearest to origin?
The system is underdetermined—the intersection of two planes is a line—so has an infinite number of solutions. The M-P inverse lets you construct a solution with minimal norm. That is, $v=A^+b$ satisfies $Av=b$ and for any other vector $w$ such that $Aw=b$, $\|v\|\le\|w\|$. It is indeed the closest point on the line to the origin.