Question about problem statement

Revision en1, by royappa, 2017-05-18 11:06:17

In a topcoder problem recently, there was this definition:

Correct parentheses sequences can be defined recursively as follows:
* The empty string "" is a correct sequence.
* If "X" and "Y" are correct sequences, then "XY" (the concatenation of X and Y) is a correct sequence.
* If "X" is a correct sequence, then "(X)" is a correct sequence.
* Each correct parentheses sequence can be derived using the above rules.

What is the purpose of the last line?

I've seen this type of extra condition many times and have to spend time thinking about whether it means something for the solution. Usually I can't think of something, and so (for me) it wastes time during a contest.

Tags analysis of problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English royappa 2017-05-18 11:06:17 740 Initial revision (published)