A train route has n n and consists of two parallel tracks: a regular route and an express route.
You are given two integer arrays regular and express of length n, where regular[i] and express[i] represent the cost to travel from stop i to stop i
You are also given an integer expressCost, which represents the cost to transfer from the regular route to the express route.
You start at stop
Traveling from stop i to stop i regular[i].
Traveling from stop i to stop i express[i].
Transferring from the regular route to the express route costs expressCost.
Transferring from the express route to the regular route costs
Return an array costs of length n, where costs[i] is the minimum cost to reach stop i
Note: Switching lines can happen before or after traveling to a stop. The transfer fee
expressCostmust be paid every time you switch from the regular route to the express route.
Constraints:
n regular.length express.length
n
regular[i], express[i], expressCost
A train route has n n and consists of two parallel tracks: a regular route and an express route.
You are given two integer arrays regular and express of length n, where regular[i] and express[i] represent the cost to travel from stop i to stop i
You are also given an integer expressCost, which represents the cost to transfer from the regular route to the express route.
You start at stop
Traveling from stop i to stop i regular[i].
Traveling from stop i to stop i express[i].
Transferring from the regular route to the express route costs expressCost.
Transferring from the express route to the regular route costs
Return an array costs of length n, where costs[i] is the minimum cost to reach stop i
Note: Switching lines can happen before or after traveling to a stop. The transfer fee
expressCostmust be paid every time you switch from the regular route to the express route.
Constraints:
n regular.length express.length
n
regular[i], express[i], expressCost