10223 - How many nodes ?


Difficulty : trivial

Solution Description :

Math Catalan Number
You can calculate Catalan number C from n=1 to 19 by using rule
C_0 = 1 quad mbox{and} quad C_{n+1}=frac{2(2n+1)}{n+2}C_n,

Input m
for n=1 to 19
---if C[n]==m then print n and break