>>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3]) [1, 3, 6] >>> calculate_turn_around_times([10, 3, 7], [10, 6, 11]) [20, 9, 18]
(
burst_times: list[int], waiting_times: list[int]
)
| 42 | |
| 43 | |
| 44 | def calculate_turn_around_times( |
| 45 | burst_times: list[int], waiting_times: list[int] |
| 46 | ) -> list[int]: |
| 47 | """ |
| 48 | >>> calculate_turn_around_times([1, 2, 3, 4], [0, 1, 3]) |
| 49 | [1, 3, 6] |
| 50 | >>> calculate_turn_around_times([10, 3, 7], [10, 6, 11]) |
| 51 | [20, 9, 18] |
| 52 | """ |
| 53 | return [burst + waiting for burst, waiting in zip(burst_times, waiting_times)] |
| 54 | |
| 55 | |
| 56 | if __name__ == "__main__": |