Available question text
Given an array of piles where each element is the number of books on a shelf, pick a contiguous segment and take books from right to left so that the number taken from each shelf is positive, at most the shelf count, and strictly decreases by at least 1 each step — maximize the total books taken. The core challenge is enforcing the decreasing-cap constraint efficiently (greedy/one-pass or monotonic strategy) over large inputs.
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 2355. Maximum Number of Books You Can Take
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source