3
vector<TreeNode *> solve(int start, int end) {8
vector<TreeNode *> lChild, rChild, res;9
// forming a tree, by keeping each node as root node10
for (int i = start; i <= end; i++) {11
// don't create node here, bcz for each combination of subtree, node with12
// new address has to be generated14
// recursive call for left,right child, they will return vector of all16
lChild = solve(start, i - 1);17
rChild = solve(i + 1, end);19
// for each subtree returned by lChild, forming combination with each20
// subtree returned by rChild21
for (auto l : lChild) {22
for (auto r : rChild) {23
// generating new node for each combination24
TreeNode *node = new TreeNode(i);25
// attaching left, right childs32
// returning all possible subtrees35
vector<TreeNode *> generateTrees(int n) {