Short and pretty python


#1

def sortedArrayToBST(self, arr):
if not arr:
return None
mid = len(arr)//2
root = TreeNode(arr[mid])
root.left = self.sortedArrayToBST(arr[:mid])
root.right = self.sortedArrayToBST(arr[mid+1:])
return root