Input : n = 1
Output : 1
Input : n = 2
Output : 2
Input : n = 3
Output : 5
This can also be done using Catalan number Cn = (2n)!/(n+1)!*n!
For n = 0, 1, 2, 3, … values of Catalan numbers are 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, ….
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Input : n = 1
Output : 1
Input : n = 2
Output : 2
Input : n = 3
Output : 5
This can also be done using Catalan number Cn = (2n)!/(n+1)!*n!
For n = 0, 1, 2, 3, … values of Catalan numbers are 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, ….