You are given a bitonic array of integers nums of length n.
A bitonic array is an array that strictly increases to a single peak element and then strictly decreases. The peak element is included in both the ascending part and the descending part.
Find the peak element and calculate two sums:
The sum of all elements in the ascending part from index
The sum of all elements in the descending part from the peak element index to index
Return:
Constraints:
nums.length
nums[i]
nums is a bitonic array.
You are given a bitonic array of integers nums of length n.
A bitonic array is an array that strictly increases to a single peak element and then strictly decreases. The peak element is included in both the ascending part and the descending part.
Find the peak element and calculate two sums:
The sum of all elements in the ascending part from index
The sum of all elements in the descending part from the peak element index to index
Return:
Constraints:
nums.length
nums[i]
nums is a bitonic array.