Search
⌘K

Leetcode 1345. Jump Game IV

Find the minimum number of jumps to reach the last index from index 0 in an array where from index i you may move to i±1 or to any other index j with the same value arr[j]; treat indices as graph nodes and compute the shortest path (n ≤ 5·10^4), taking care to handle potentially many equal-value edges efficiently.


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.