Easiest Code with 100% Beats || In line explanation || C++ || If you don't like it give me down vote
\nThanks for visiting my solution.\uD83D\uDE0A Keep Learning\nPlease give my solution an upvote! \u2B06\uFE0F\uD83D\uDC4D\nIt\'s a simple way to show your appre
```\nThanks for visiting my solution.\uD83D\uDE0A Keep Learning\nPlease give my solution an upvote! \u2B06\uFE0F\uD83D\uDC4D\nIt\'s a simple way to show your appreciation and\nkeep me motivated. Thank you! \uD83D\uDE0A\n```\n# Intuition\nMy first thought are so silly then i switched to this approach:-\nfirst i will find length of array\nand i know that array is sorted so i dont have issue with sorting array\nso i jumped into next portion which is how we put nodes in right posistion\nso for that i find the mid element of that array and put that element as root\nthen what ever in left side of that mid element i started puting that value in left side not\nas for right side also\nand we are done with making that tree\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\ni wrote the approach in Intuition and if you want more clearification then read code i wrote in line explanation also for my code\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: **O(N)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O(1)**\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp [C++ If You Like My Solution Please Give Me Upvote :)]\n\nclass Solution {\nprivate:\n    TreeNode* convertBST(int left, int right, vector<int>& arr)\n    {\n        /* if i dont have any element in array then my right becomes\n           -1 cause my right is my size and my size is 0 - 1 means\n           -1 so from that i can say i don\'t have element and return\n           nullptr.\n        */\n        if(left > right)\n        {\n            return nullptr;\n        }\n        // calculate the value of mid\n        /*\n           we write left + ((right - left) / 2) cause at some point\n           if we write (left + right) / 2 will go outside of my \n           integer if my left and right both are big number in that\n           case this type of probelm is occurs so for that we use\n           that left + ((right - left) / 2) both gives same answer\n        */\n        int mid = left + ((right - left) / 2);\n        // creating new tree and put mid value at root node\n        TreeNode* root = new TreeNode(arr[mid]);\n        /* in left size node we have to put the value of left side\n           array and for that we are going left in tree and we put\n           mid - 1 value from array and we are calling this function\n           recursively\n        */\n        root -> left = convertBST(left, mid - 1, arr);\n        /* in right size node we have to put the value of right side\n           array and for that we are going right in tree and we put\n           mid + 1 value from array and we are calling this function\n           recursively\n        */\n        root -> right = convertBST(mid + 1, right, arr);\n        // at the end we are returning the root(means whole tree)\n        return root;\n    }\npublic:\n    TreeNode* sortedArrayToBST(vector<int>& nums) {\n        // fetching size of the array nums\n        int size = nums.size() - 1;\n        return convertBST(0, size, nums);\n    }\n};\n```
['C++']