Beats 100% || Easy Clean Code with Comments
Please Upvote,it helps a lot\n\n\nclass Solution {\n    public TreeNode sortedArrayToBST(int[] nums) {\n        return findans(nums,0,nums.length - 1);\n    }\n
**Please Upvote,it helps a lot**\n\n```\nclass Solution {\n    public TreeNode sortedArrayToBST(int[] nums) {\n        return findans(nums,0,nums.length - 1);\n    }\n    \n    private TreeNode findans(int [] nums,int left,int right){\n        if(right < left ) return null; //base case\n  \n        int mid = (left + right) /2;\n        TreeNode root = new TreeNode(nums[mid]); //make a node and call recursion\n        \n       \n        TreeNode leftSubtree = findans(nums,left,mid - 1);\n        \n        TreeNode rightSubtree = findans(nums,mid + 1,right);\n //after recursion we expect that we have left and right subtree so now join them       \n         root.left = leftSubtree;\n         root.right = rightSubtree;\n        return root;\n    }\n}\n```
['Divide and Conquer', 'Recursion', 'Binary Tree', 'Java']