Available question text
Count subarrays of length >= 3 where the smaller endpoint is strictly greater than every interior element — equivalently, count pairs (i, j) with j - i >= 2 and max(nums[i+1..j-1]) < min(nums[i], nums[j]). The challenge is to compute this for n up to 1e5 efficiently by exploiting monotonic/next-greater relationships rather than checking all pairs.
Related questions
Continue with questions that share topics or the same question type.
- Count Alternating Subarrays
Coding
- Count Complete Subarrays in an Array
Coding
- Count Non-Decreasing Subarrays After K Operations
Coding
- Count Number of Nice Subarrays
Coding · Array · Hash Table · Math
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3676. Count Bowl Subarrays
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source