[Tex/LaTex] Error of “missing \item” in enumerate when using custom bullets

#enumeratelists

I'm using enumerate to type up homework solutions, based on the following MWE. When I remove the [(a)] from the enumerate, there isn't an error, but when I add it, I get the "perhaps a missing \item" error. How can I fix this? I don't want to add an \item in front of the solution, since it isn't part of the list per se, and I don't want to remove the custom bullet because in my full document, this is part of a nested list.

\documentclass[12pt]{article}

\begin{document}
\begin{enumerate}[(a)]
\item $n(n+1)/2 \in O(n^3)$

True, because $n(n+1)/2$ is of order 2, which is less than order 3. 

\item $n(n+1)/2 \in O(n^2)$

\end{enumerate}
\end{document}

Best Answer

You need to include the enumerate package, since it redefines the enumerate environment to manage an optional argument:

enter image description here

\documentclass[12pt]{article}
\usepackage{enumerate}% http://ctan.org/pkg/enumerate
\begin{document}
\begin{enumerate}[(a)]
\item $n(n+1)/2 \in O(n^3)$

True, because $n(n+1)/2$ is of order 2, which is less than order 3. 

\item $n(n+1)/2 \in O(n^2)$

\end{enumerate}
\end{document}‚Äč

A similar format would have been achieved with the enumitem package:

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
%...
\begin{enumerate}[label=(\alph*)]
  %...
\end{enumerate}