# queues medium

The Print Queue

The class printer does one page per minute, jobs strictly in order. When does YOUR homework finish? 🖨️

You get the jobs as name:pages (front first) and a target name (present once). Print the minute the target job finishes — all pages of every job before it, plus its own.

Example:

Input: jobs = ["essay:3", "comic:5", "homework:2", "poster:4"], target = "homework" Output: 10

essay's 3 pages, plus comic's 5, plus homework's own 2 pages finish at minute 3 + 5 + 2 = 10.

💡 need a hint?

q-print-queue.py🔒 given lines are locked — write your code in between
loading...