单点时限: 2.0 sec
内存限制: 512 MB
Write a program that expands shorthand notations like a-z
in the string abc...xyz
in 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 -
.
a-z
abcdefghijklmnopqrstuvwxyz
a-b-c
abc
a-z0-9
abcdefghijklmnopqrstuvwxyz0123456789
-a-z
-abcdefghijklmnopqrstuvwxyz
abcA-C
abcABC