You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:
nums.Return the maximum binary tree built from nums.
Input: nums = [3,2,1,6,0,5]
Output: [6,3,5,null,2,0,null,null,1]
Input: nums = [3,2,1]
Output: [3,null,2,null,1]
1 <= nums.length <= 10000 <= nums[i] <= 1000nums are unique.The problem requires constructing a binary tree where the root is the maximum number in the list, the left subtree is constructed from the elements before this maximum number, and the right subtree is from the elements after this maximum number. This naturally suggests a recursive approach where at each step, we select the maximum element as the root and recursively construct the left and right subtrees from the remaining elements.
null since there's no tree to be constructed.