Skip to content

Practice Increasing Triplet Subsequence

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#334
LeetCode Problem

Increasing Triplet Subsequence

Problem Statement

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.

Source: Increasing Triplet Subsequence on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,2,3,4,5]
Output
true

# Example 2

Input
nums = [5,4,3,2,1]
Output
false

# Example 3

Input
nums = [2,1,5,0,4,6]
Output
true

Constraints

1 <= nums.length <= 5 * 10^5
-2^31 <= nums[i] <= 2^31 - 1

Related LeetCode Problems

Practice more problems similar to Increasing Triplet Subsequence.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.