0334. Increasing Triplet Subsequence
https://leetcode.com/problems/increasing-triplet-subsequence
Description
Given an integer array nums
, return true
if there exists a triple of indices (i, j, k)
such that i < j < k
and nums[i] < nums[j] < nums[k]
. If no such indices exists, return false
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 5 * 105
-231 <= nums[i] <= 231 - 1
Follow up: Could you implement a solution that runs in O(n)
time complexity and O(1)
space complexity?
ac
no topic, trick
Last updated