Python Simple Recursion || Runtime Beats 98.92% || Memory Beats 97.64%
If you got help from this,... Plz Upvote .. it encourage me\n# Code\n\n# Definition for a binary tree node.\nclass TreeNode:\n    def __init__(self, val=0, left
**If you got help from this,... Plz Upvote .. it encourage me**\n# Code\n```\n# Definition for a binary tree node.\nclass TreeNode:\n    def __init__(self, val=0, left=None, right=None):\n        self.val = val\n        self.left = left\n        self.right = right\nclass Solution:\n    def sortedArrayToBST(self, nums: List[int]) -> Optional[TreeNode]:\n        n = len(nums)\n\n        if not n:\n            return None\n        \n        mid = (n-1)//2\n        root = TreeNode(nums[mid])\n\n        root.left = (self.sortedArrayToBST(nums[:mid]))\n        root.right = (self.sortedArrayToBST(nums[mid+1:]))\n        \n        return root\n      \n\n```
['Binary Search Tree', 'Recursion', 'Binary Tree', 'Python', 'Python3']