<s>[INST] linear algebra matrix Given the following matrix $A$, find an invertible matrix $U$ so that $UA$ is equal to the reduced row-echelon form of $A$:
$$
A=\begin{bmatrix}
0 & 2 & 2 & 2 \\
0 & 3 & 3 & 3 \\
1 & 1 & -1 & -2
\end{bmatrix}
$$
 [/INST] *

*Swap rows $1$ and $3$, i.e. pre-multiply  by the matrix $\;U_1=\begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$. You get
$$\begin{bmatrix}1&1&-1&-2\\0&2&2&2\\0&3&3&3\end{bmatrix}. $$

*Multiply the (new) second row by $1/2$,  i.e. multiply  by the matrix $\;U_2=\smash{\begin{bmatrix}1&0&0\\0&\frac12&0\\0&0&1\end{bmatrix}}$ to get
$$\begin{bmatrix}1&1&-1&-2\\0&1&1&1\\0&3&3&3\end{bmatrix}. $$

*$R_3\leftarrow R_3-3R_2$, i.e. multiply on the left by $\;U_3=\begin{bmatrix}1&0&0\\0&1&0\\0&-3&1\end{bmatrix}$ to get
$\begin{bmatrix}1&1&-1&-2\\0&1&1&1\\0&0&0&0\end{bmatrix}. $

*Substract $R_2$ from $R_1$, i.e. multiply on the left by $\;U_4=\smash[b]{\begin{bmatrix}1&-1&0\\0&1&0\\0&0&1\end{bmatrix}}$ to get the reduced row echelon form:
$$\begin{bmatrix}1&0&-2&-3\\0&1&1&1\\0&0&0&0\end{bmatrix}.\qquad\qquad  $$
In all you have multiplied by
$$U=U_4U_3U_2U_1.$$

</s>