Skip to content

不同的二叉搜索树 #1071

@pwstrick

Description

@pwstrick

96. 不同的二叉搜索树

/**
 * @param {number} n
 * @return {number}
 */
var numTrees = function(n) {
    let c = 1;
    for(let i=0; i<n; i++) {
        c = c * 2 * (2*i+1) / (i+2);
    }
    return c;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    LeetcodeLeetcode的题目

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions