Available question text
Given n, index, and maxSum, find the largest possible value at nums[index] in a length-n array of positive integers where adjacent elements differ by at most 1 and the total sum ≤ maxSum. The key is to test candidate peak values (e.g., by binary search) and compute the minimal total sum formed by 1-step ramps (triangular/pyramid shapes) extending from that peak to both ends to check feasibility.
Related questions
Continue with questions that share topics or the same question type.
- Given an array nums and a sliding window of size k moving from the very left to the very right, return the maximum value in the window for each position. Solve in O(n) time using a deque.
Coding
- Find the Maximum Sequence Value of Array
Coding
- Given an array of integers and a target value, return the indices of two numbers that add up to the target
Coding
- Maximum Value of a String in an Array
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
No company association
Leetcode 1802. Maximum Value at a Given Index in a Bounded Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source