  Cyclic codes are a subclass of linear codes and have applications in consumer
electronics, data storage systems and communication systems as they have
efficient encoding and decoding algorithms. In this paper, we settle an open
problem about a class of optimal ternary cyclic codes which was proposed by
Ding and Helleseth. Let $C_{(1,e)}$ be a cyclic code of length $3^m-1$ over
GF(3) with two nonzeros $\alpha$ and $\alpha^e$, where $\alpha$ is a generator
of $GF(3^m)^*$ and e is a given integer. It is shown that $C_{(1,e)}$ is
optimal with parameters $[3^m-1,3^m-1-2m,4]$ if one of the following conditions
is met. 1) $m\equiv0(\mathrm{mod}~ 4)$, $m\geq 4$, and $e=3^\frac{m}{2}+5$. 2)
$m\equiv2(\mathrm{mod}~ 4)$, $m\geq 6$, and $e=3^\frac{m+2}{2}+5$.
