Available question text
Find indices i (k <= i < n-k) such that the k elements before i form a non-increasing sequence and the k elements after i form a non-decreasing sequence. Precompute lengths of non-increasing suffixes and non-decreasing prefixes (or equivalent) to test each candidate in O(1), yielding an overall O(n) time and O(n) space solution.
Related questions
Continue with questions that share topics or the same question type.
- Find All Good Strings
Coding
- Find All K-Distant Indices in an Array
Coding
- Find a Good Subset of the Matrix
Coding
- Find All Anagrams in a String
Coding · Hash Table · Sliding Window · String
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 2420. Find All Good Indices
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source