  The spectrum $\omega(G)$ of a finite group $G$ is the set of orders of
elements of $G$. We present a polynomial-time algorithm that, given a finite
set $\mathcal M$ of positive integers, outputs either an empty set or a finite
simple group $G$. In the former case, there is no finite simple group $H$ with
$\mathcal{M}=\omega(H)$, while in the latter case,
$\mathcal{M}\subseteq\omega(G)$ and $\mathcal{M}\neq\omega(H)$ for all finite
simple groups $H$ with $\omega(H)\neq\omega(G)$.
