Catalan number problem

https://ide.geeksforgeeks.org/3Uh4xMRAyl---all test cases are not passing what is the error in the code?

/bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe ----plus this error is shown when i try to compile the code but it complies fine on dev c++ compiler and gfg ide.

The time complexity of your approach is exponential

Use something like memoization to reduce it to polynomial time.