You are given an integer array nums consisting of positive integers.
You can perform the following operation on the array any number of times:
Choose an index i such that i nums.length nums[i] nums[i + 1]. Replace the element nums[i + 1] with nums[i] nums[i + 1] and remove nums[i] from the array.
Return the maximum value of an element that can be obtained in the array after performing any number of operations.
Constraints:
nums.length
nums[i]
You are given an integer array nums consisting of positive integers.
You can perform the following operation on the array any number of times:
Choose an index i such that i nums.length nums[i] nums[i + 1]. Replace the element nums[i + 1] with nums[i] nums[i + 1] and remove nums[i] from the array.
Return the maximum value of an element that can be obtained in the array after performing any number of operations.
Constraints:
nums.length
nums[i]