-
Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:描述:
q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses before the ith right parenthesis in S (P-sequence).
q By an integer sequence W = w1 w2...wn where for each right parenthesis, say a in S