#2662

Minimum Cost of a Path With Special Roads

specialist · 985 · lc medium +32 · 42.5% accepted · 701 likes · top 24%

Description

You start at start = [startX, startY] in a 2D plane and need to reach target = [targetX, targetY]. Moving between any two points costs their Manhattan distance. Special one-directional roads in specialRoads each have a fixed cost and may be used repeatedly. Return the minimum total cost to reach the target.

Code

1
2
3