Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Simulate order processing across multiple shoppers to calculate average customer wait times.
Determine the minimum number of shoppers required to keep the average wait time at or below a threshold k.
Return -1 if the inherent duration of orders makes the target average unattainable regardless of shopper count.
What This Tests
Monotonic property identification for optimization problems
Priority queue simulation for resource allocation
Binary search over a discrete solution space
Feasibility bounding and edge case handling
Common Patterns
Binary Search on Answer
Heap / Priority Queue
Sorting
Greedy
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
2.2k
/5.8k
Acceptance Rate
37.1%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
orders =
k =
Output
Expected