You are given an integer array cost of length n.
You want to reach every target position i from n i, you may choose any index j such that cost[j].
Return an integer array ans of length n, where ans[i] is the minimum cost required to reach position i.
Constraints:
n cost.length
cost[i]
You are given an integer array cost of length n.
You want to reach every target position i from n i, you may choose any index j such that cost[j].
Return an integer array ans of length n, where ans[i] is the minimum cost required to reach position i.
Constraints:
n cost.length
cost[i]