$$A =\left(\begin{array}{rrrr} 0 & 1 & -1 & 1\\ -1 & 2 & -1 & 1\\ 0 & 0 & 1 & -1\\ 0 & 0 & 0 & 0 \end{array}\right).$$
We have this matrix, we want to find the characteristic and the minimal polynomial.
I have done the following:
First I used the formula $\det(A -\lambda I) = 0$, then I got this determinant into upper triangular form by getting rid of the $-1$ in the second row. Then I multiplied the diagonal and got :
$$(\lambda +1+ \sqrt{2})(\lambda + 1- \sqrt{2})(1-\lambda)(-\lambda) = 0 = p(\lambda)$$
Wolfram alpha gives the same result.
However the solution says that the characteristic and minimal polynomial should be $$p_A(\lambda) = \lambda(\lambda-1)^3,\quad m_A(\lambda) = \lambda(\lambda -1)^2.$$
I do not understand how they got there or where is the mistake in my process.