Tuesday, December 6, 2011

Generate all the valid parenthesis for a string whose length is n

Solution:

- left parenthesis ( is valid if we have any left
- right parenthesis ) is valid if we have any left and there is no syntax error

An interesting problem is to validate a string made of parenthesis

No comments:

Post a Comment