Search
⌘K

Leetcode 656. Coin Path

Given an array of coin costs (with some positions possibly blocked) and a maximum jump length B, find a sequence of jumps from the first to the last index that minimizes the total cost; if multiple sequences have equal cost return the lexicographically smallest index sequence, or empty if unreachable. This is essentially a shortest-path/DP on a directed acyclic graph with a lexicographic tie-breaker constraint.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.