Shopping and Billing

Problem Overview

  • Given N counters and M arrivals at time[i], each person picks the counter with the shortest queue; report the time each person finishes billing.
  • Input: N, M, time array. Output: finish time per person in arrival order. Each bill takes 1 time unit; counters work continuously.
  • Context: Retail checkout queue management with real-time arrivals.
  • Constraints unspecified (TO-DO) in the statement.
  • From Wework interviews; a coding interview problem and typical interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: