An ultra-low-latency order routing protocol at Citadel transmits data packets through sequential exchange routing hubs, indexed from to . Moving from hub to hub can be accomplished via two transmission modes:
standard[i].express[i].Mode Switching Invariant:
switch_cost.Your Task
Implement min_latency_routing(standard: list[int], express: list[int], switch_cost: int) -> list[int] that calculates an array of size , where index represents the minimum total latency to reach hub from hub .
Constraints
Examples
standard = [2, 3, 4]
express = [3, 1, 1]
switch_cost = 2
# Hub 0: 0
# Hub 1: min(standard 0+2=2, express 0+2+3=5) = 2
# Hub 2: reach via express = 2 + 2(switch) + 1 = 5, or standard = 2 + 3 = 5
# Hub 3: stay on express = 5 + 1 = 6
# Output: [0, 2, 5, 6]