单点时限: 2.0 sec
内存限制: 512 MB
Write a program that expands shorthand notations like a-z
in the string $s_1$ into the equivalent complete list abc...xyz
in $s_2$. Allow for letters of either case and digits, and be prepared to handle cases like a-b-c
and a-z0-9
and -a-z
. Arrange that a leading or trailing -
is taken literally.
You can assume that the input string does not exceed $10$, only contains letters of both cases, digits, and -
.
a-z
abcdefghijklmnopqrstuvwxyz
a-b-c
abc
a-z0-9
abcdefghijklmnopqrstuvwxyz0123456789
-a-z
-abcdefghijklmnopqrstuvwxyz
abcA-C
abcABC