MeetCode
Catalan Number Cn
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Catalan Number Cn
Hard
Computer Mathematics
Trees & Counting
36 views
Explanation
Complexity
Problem Statement
Compute the n-th Catalan number for n
Input Format
One integer n.
Output Format
One integer.
Example
Input
4
Output
14
Constraints
0
Input / Output Format
Input Format
One integer n.
Output Format
One integer.
Constraints
0
Examples
Input:
4
Output:
14
Example Solution (Public)
Computer Mathematics
Use formula Cn = (1/(n+1))*C(2n,n). Compute using integer nCr then divide by (n+1).
Official Solution Code
Wrap
Copy
Use formula Cn = (1/(n+1))*C(2n,n). Compute using integer nCr then divide by (n+1).
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
4
Expected Output
14
Compile Output
Error
Output
Please
login
to submit solutions.