Available question text
Replace each element in the array with the greatest element among those to its right (and set the last element to -1). This is typically solved by scanning from right to left while tracking the running maximum to get O(n) time and O(1) extra space.
Related questions
Continue with questions that share topics or the same question type.
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 1299. Replace Elements with Greatest Element on Right Side
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source