You are given an integer array nums.
A triplet of indices (i, j, k) is called an increasing triplet if:
i j k
nums[i] nums[j] nums[k]
The value of an increasing triplet (i, j, k) is equal to nums[i] - nums[j] + nums[k].
Return the maximum value among all increasing triplets in nums.
Constraints:
nums.length
nums[i]
The input is generated such that at least one triplet meets the given condition.
You are given an integer array nums.
A triplet of indices (i, j, k) is called an increasing triplet if:
i j k
nums[i] nums[j] nums[k]
The value of an increasing triplet (i, j, k) is equal to nums[i] - nums[j] + nums[k].
Return the maximum value among all increasing triplets in nums.
Constraints:
nums.length
nums[i]
The input is generated such that at least one triplet meets the given condition.