Catalan Formula = 2n!/(n+1!*n!)

```
class Solution(object):
def numTrees(self, n):
facn=1
for i in range(1,n+1):
facn *= i
fac2n=facn
facnp=facn*(n+1)
for i in range(n+1,2*n+1):
fac2n *= i
ans = fac2n/(facn*facnp)
return ans
```