Loading...
You are given a list of integers nums. Return whether there exist indices i < j < k such that nums[i] < nums[k] < nums[j].
nums
i < j < k
nums[i] < nums[k] < nums[j]
In other words, three positions in order whose values go small, then large, then medium.
Input: nums = [1,2,3,4] Output: false
Input: nums = [3,1,4,2] Output: true Explanation: nums[1] = 1 < nums[3] = 2 < nums[2] = 4.
Input: nums = [-1,3,2,0] Output: true Explanation: nums[0] = -1 < nums[2] = 2 < nums[1] = 3.
nums.length
nums[i]