Tap here to switch tabs
Problem
Submissions

Problem: 132 Pattern

med
30 min
Try to solve the 132 Pattern problem.

Statement

Given an integer array nums, determine whether there exist indices i, j, and k such that i < j < k and the values form a 132 pattern, meaning nums[i] < nums[k] < nums[j]. Return true if at least one such triple exists, otherwise return false.

Constraints:

  • n == nums.length

  • 1≤1 \leq n ≤2⋅105\leq 2 \cdot 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: 132 Pattern

med
30 min
Try to solve the 132 Pattern problem.

Statement

Given an integer array nums, determine whether there exist indices i, j, and k such that i < j < k and the values form a 132 pattern, meaning nums[i] < nums[k] < nums[j]. Return true if at least one such triple exists, otherwise return false.

Constraints:

  • n == nums.length

  • 1≤1 \leq n ≤2⋅105\leq 2 \cdot 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9