Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Simulate assigning books to shelves where each book has a restricted upper index bound.
Pick the shelf with the fewest books within that bound, using index as a tie-breaker.
Track and update shelf occupancy dynamically across a sequence of assignments.
What This Tests
Min-heap implementation and custom comparator logic
Dynamic state management with frequent updates
Filtering elements based on positional constraints
Greedy resource allocation strategies
Common Patterns
Heap / Priority Queue
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
1k
/1.8k
Acceptance Rate
56.3%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
numServers =
requests =
Output
Expected