K shortest waits
Your task
A hospital triage board tracks how long each waiting patient has been in the queue, in minutes. The charge nurse wants the k shortest waits, in ascending order, to spot who was seen fastest during an audit. Write a function that returns those k values. If k exceeds the number of patients, return all waits in ascending order; if k is zero, return an empty list. Ties are fine, repeated wait times each count. Example: waits = [30, 5, 12, 48], k = 2 gives [5, 12].
Examples
shortest_wait_times(waits: list[int], k: int) -> list[int]Example 1
Input
shortest_wait_times([30, 5, 12, 48], 2)Output
[5, 12]