Solution (source code)

= Solution

\b[False in general.] Take $A=\operatorname{diag}(1,6,6)$ and $B=\operatorname{diag}(2,2,9)$. Both have <trace> $13$ and <determinant> $36$, but their <eigenvalue> multisets are different. For $n>3$, append equal identity blocks to preserve this counterexample. In dimensions one and two the assertion is true: in dimension two the <characteristic polynomial> is $t^2-(\operatorname{tr}A)t+\det A$, whose roots, with multiplicity, are determined by those two quantities.