Skip to content

Instantly share code, notes, and snippets.

@honux77
Created May 7, 2014 12:54
Show Gist options
  • Select an option

  • Save honux77/215dbb546c502c25aedf to your computer and use it in GitHub Desktop.

Select an option

Save honux77/215dbb546c502c25aedf to your computer and use it in GitHub Desktop.
public class Solution {
public int numTrees(int n) {
int c = 1;
for (int i = 2; i <= n; i++)
c = 2 * (2 * i - 1) * c / (i + 1);
return c;
}
}
@honux77
Copy link
Copy Markdown
Author

honux77 commented May 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment