I will give more details to other answers.
For a specific $\lambda_i$, the idea is to transform the matrix $A$ (n by n) to matrix $B$ which shares the same eigenvalues as $A$. If $P_1=[v_1, \cdots, v_m]$ are eigenvectors of $\lambda_i$, we expand it to the basis $P=[P_1, P_2]=[v_1, \cdots, v_m, \cdots, v_n]$. Therefore, $AP=[\lambda_i P_1, AP_2]$. In order to make $P^{-1}AP=B$, we must have $AP=PB$. Let $B= \begin{bmatrix} B_{11} & B_{12} \\
B_{21} & B_{22} \end{bmatrix}$, then $P_1B_{11}+P_2B_{21}=\lambda_i P_1$ and $P_1B_{12}+P_2B_{22}=AP_2$. Because $P$ is a basis, $B_{11}=\lambda_iI$(m by m), $B_{21}=\mathbf{0}$ ($(n-m)\times m$). So, we have $B=\begin{bmatrix} \lambda_iI & B_{12}\\ \mathbf{0} & B_{22} \end{bmatrix}$.
$\det(A-\lambda I)=\det(P^{-1}(A-\lambda I)P)=\det(P^{-1}AP-\lambda I)=det(B-\lambda I)$ $ = \det \Bigg(\begin{bmatrix} (\lambda_i-\lambda)I & B_{12}\\ \mathbf{0} & B_{22}-\lambda I \end{bmatrix} \Bigg)=(\lambda_i-\lambda)^{m}\det(B_{22}-\lambda I)$.
Obviously, $m$ is no bigger than the algebraic multiplicity of $\lambda_i$.