{"size": 647, "ext": "js", "max_stars_repo_path": "1-100/95.js", "max_stars_repo_name": "hangfengnice/leetcode", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "1-100/95.js", "max_issues_repo_name": "hangfengnice/leetcode", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "1-100/95.js", "max_forks_repo_name": "hangfengnice/leetcode", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.962962963, "max_line_length": 50, "alphanum_fraction": 0.542503864}
var generateTrees = function (n) {
  if (n === 0) return [];
  return generateTrees(1, n);

  function generateTrees(start, end) {
    let allTrees = [];
    if (start > end) {
      allTrees.push(null);
      return allTrees;
    }
    for (let i = start; i <= end; i++) {
      let leftTrees = generateTrees(start, i - 1);
      let rightTrees = generateTrees(i + 1, end);

      for (let left of leftTrees) {
        for (let right of rightTrees) {
          let currTree = new TreeNode(i);
          currTree.left = left;
          currTree.right = right;
          allTrees.push(currTree);
        }
      }
    }
    return allTrees;
  }
};
