C++ solution
\nDivide and Conquer:-\n\nAs the tree is heightbalanced the root will be present at the n/2 location of the nums array where n is the size of the array.\nSo we 
```\nDivide and Conquer:-\n\nAs the tree is heightbalanced the root will be present at the n/2 location of the nums array where n is the size of the array.\nSo we can use this base case to build our tree\n[-10,-3,0,5,9]\n\n0 will be the root.\nThen we pass the left part of the array to root->left and right part of the array to root right and repeat the same procedure.\n\n\n1.    0\n\n\nroot->left = build(nums,l,m-1)\n\n|      |\n|  -10 |\n|  -3  |\n|______|\n\n2.   0\n    /\n  -10\n    \\\n    -3\n\nand we repeat this procedure to get the answer\n\n\n    {\n        if(l>r)return NULL;\n        int m=(l+r)/2;\n        TreeNode* newnode=new TreeNode(nums[m]);\n        newnode->left=makeBST(nums,l,m-1);\n        newnode->right=makeBST(nums,m+1,r);\n        return newnode;\n    }\n    TreeNode* sortedArrayToBST(vector<int>& nums) {\n        return makeBST(nums,0,nums.size()-1);\n    }\n```
['C', 'C++']