16 ms C++ solution
\n    class Solution {\n        TreeNode sortedArrayToBST(vector& nums, int start, int end){\n            if(end<=start) return NULL; \n            int midIdx=(
\n    class Solution {\n        TreeNode* sortedArrayToBST(vector<int>& nums, int start, int end){\n            if(end<=start) return NULL; \n            int midIdx=(end+start)/2;\n            TreeNode* root=new TreeNode(nums[midIdx]);\n            root->left=sortedArrayToBST(nums, start, midIdx);\n            root->right=sortedArrayToBST(nums, midIdx+1,end);\n            return root;\n        }\n    public:\n        TreeNode* sortedArrayToBST(vector<int>& nums) {\n            return sortedArrayToBST(nums, 0,nums.size());\n        }\n    };
['C++']