Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3502. Minimum Cost to Reach Every Position
Starting from position n you can reach any target i by paying some person j ≤ i to swap once (cost[j]) and then moving through the rest for free, so the minimum cost to reach i is simply the minimum of cost[0..i]; compute these prefix minima for all i.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.