public int numTrees(int n) {
        long a = 1;
        long b = 1;
        for(int i = 2*n;i> n+1;i--)
            a*= i;
        for(int i=n;i>0;i--)
            b *= i;
        return (int) (a/b);
    }