My LeetCode grinding. Trying to do a problem a day.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425
  1. Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:
  2. The root is the maximum number in the array.
  3. The left subtree is the maximum tree constructed from left part subarray divided by the maximum number.
  4. The right subtree is the maximum tree constructed from right part subarray divided by the maximum number.
  5. Construct the maximum tree by the given array and output the root node of this tree.
  6. Example 1:
  7. Input: [3,2,1,6,0,5]
  8. Output: return the tree root node representing the following tree:
  9. 6
  10. / \
  11. 3 5
  12. \ /
  13. 2 0
  14. \
  15. 1
  16. Note:
  17. The size of the given array will be in the range [1,1000].