Available question text
For each element in nums, find the first element to its right that is strictly greater and then the next strictly greater element after that (i.e., the "second greater" to the right), or return -1 if none exists. The challenge is to compute all answers efficiently for n up to 1e5, typically using monotonic-stack techniques to track candidate indices.
Related questions
Continue with questions that share topics or the same question type.
- Find Next Greater Element in Sorted Array
Coding
- Next Greater Element I
Coding · Array · Hash Table · Monotonic Stack
- Next Greater Element II
Coding
- Next Greater Element III
Coding
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
DoorDash
Leetcode 2454. Next Greater Element IV
Reported Jun 22, 2025 · 1 source report
STAFF
Source snapshot: Nov 12, 2026
View source