I have to write the equation written in image, i use array to create the first big curly brace, now I've tried to nest another array to write second curly brace but I get error.

This is the code that gave me error:
DTW(A,B)=\left\{ \begin{array}{l}
0 \quad \text{se $n$=0 ed $m$=0}\\
\infty \quad \text{se $n$=0 o $m$=0}\\
d(H(A),H(B))+\min\left\{
\begin{array}{1}
a\\
b\\
c\\
\end{array}
\right.
\end{array} \right.
How can I write this equation? Thank you.


{1}after the inner\begin{array}should be{l}(an "ell", not a "one"). The error wasIllegal character in array arg. – egreg May 2 '12 at 15:331(one) instead ofl(ell) in the second array spec. - Gah, Ninja'd. – Stephan Lehmke May 2 '12 at 15:33