Python3    || 3 lines, recursion, w/explanation    ||    T/S: 95% / 46%
\nHere\'s the plan: \n- Because it\'s a sorted array, we can assign the middle element as the root. (Middle here is index len(nums//2)); the elements to the lef
\nHere\'s the plan: \n- Because it\'s a sorted array, we can assign the middle element as the root. (Middle here is index `len(nums//2))`; the elements to the left of the root element comprise the left subtree, and the elements to its right comprise the right subtree. For example, let:\n```\n            nums = [1,4,5,6, _8_, 9,10,11,14] ; len(nums) == 9\n````\n\n- The middle element is `nums[9//2] = nums[4]= 8`, so the left subtree is `[1,4,5 6]` and the right subtree is `[9,10,11,14]`.\n```           \n                       ____8____\n                      /         \\\n             [1,4,_5_,6]        [9,10,_11_,14]\n\n```\n- Next we repeat the process for the subtree of the left and right subtrees:\n\n                        ______8______             \n                     /                \\\n                    5                  11\n                   / \\                /   \\\n           [1,_4_, None]  [6]     [9,_10_, None]   [14]\n\n- We continue on recursively until the subtrees are completed.\n\n                              __8_____\n                             /        \\\n                             5         _11\n                           / \\       /   \\\n                          4   6     10    14\n                         /         /\n                        1         9\n\n```\nclass Solution: \n    def sortedArrayToBST(self, n: list[int]) -> TreeNode:\n\n        if not n: return None                                           # <-- base case: leaf\n        m = len(n)//2\n\n        return TreeNode(n[m],self.sortedArrayToBST(n[:m]),              # <-- left  subtree\n                             self.sortedArrayToBST(n[m+1:]))            # <-- right subtree\n```\n[https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/submissions/1265378899/](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/submissions/1265378899/)\n\nI could be wrong, but I think that time complexity is *O*(*N* log *N*) and space complexity is *O*(*N*), in which *N* ~ `len(n)`.
['Python3']