# queues advanced

The Give-Up Point

Each person in line has a patience limit. Service takes m minutes per person — when your turn comes, if the clock has passed your patience, you storm off unserved. 😤

You get the line as name:patience pairs and the minutes m. The clock starts at 0; a person is served if their patience is AT LEAST the clock time when they reach the front (serving then advances the clock by m; storming off takes no time). Print served <count> left <count>.

Example:

Input: people = ["mia:0", "leo:5", "kai:5", "ana:20"], m = 10 Output: served 2 left 2

Mia is served at clock 0 (patience 0 ≥ 0), and the clock advances to 10. Leo's patience 5 < 10, so he storms off; kai's patience 5 < 10 too. Ana's patience 20 ≥ 10, so she's served — 2 served, 2 left.

💡 need a hint?

q-give-up-point.py🔒 given lines are locked — write your code in between
loading...