Simple Swift solution
class Solution {\n      func sortedArrayToBST(nums: [Int]) -> TreeNode? {\n        \n        guard !nums.isEmpty else { return nil }\n        \n        let mid 
    class Solution {\n      func sortedArrayToBST(nums: [Int]) -> TreeNode? {\n        \n        guard !nums.isEmpty else { return nil }\n        \n        let mid = nums.count / 2\n        \n        let treeNode = TreeNode(nums[mid])\n        \n        treeNode.left = sortedArrayToBST(Array(nums[0..<mid]))\n        treeNode.right = sortedArrayToBST(Array(nums[mid + 1..<nums.count]))\n    \n        return treeNode\n      }\n    }
[]