Solution (source code)

= Solution
{c}

If $A$ is an <invertible matrix>, then
$$
BA=A^{-1}(AB)A.
$$
If instead $B$ is an <invertible matrix>, then
$$
AB=B^{-1}(BA)B.
$$
Thus in either case $AB$ and $BA$ are <similar matrices>. Explicitly, whenever $Y=P^{-1}XP$ and $Xu=\lambda u$ with $u\ne0$, one has $Y(P^{-1}u)=\lambda P^{-1}u$ and $P^{-1}u\ne0$. Applying the same argument with $P^{-1}$ in place of $P$ proves equality of the sets of <eigenvalues>, including zero.