문제

We are given "N" pairs of parentheses, ie "N" opening parenthesis "(" and "N" closing parenthesis ")". We are asked to find the number of ways to make Sequence of 2N parentheses that are GOOD, i.e. we dont close before opening.

I need to find a definition for GOOD Sequences that i can use for the rest of the problem.

도움이 되었습니까?

해결책

Catalan numbers!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top