You are given two integer arrays nums and costs, both of length n, indexed from
You begin at index i, you are permitted to jump to another index j such that i j if and only if at least one of the following conditions is satisfied:
nums[i] nums[j] and nums[k] nums[i] for every index k where i k j.
nums[i] nums[j] and nums[k] nums[i] for every index k where i k j.
The cost incurred by jumping from index i to index j is equal to costs[j].
Return the minimum total cost required to reach index
Constraints:
n nums.length costs.length
n
nums[i], costs[i]
You are given two integer arrays nums and costs, both of length n, indexed from
You begin at index i, you are permitted to jump to another index j such that i j if and only if at least one of the following conditions is satisfied:
nums[i] nums[j] and nums[k] nums[i] for every index k where i k j.
nums[i] nums[j] and nums[k] nums[i] for every index k where i k j.
The cost incurred by jumping from index i to index j is equal to costs[j].
Return the minimum total cost required to reach index
Constraints:
n nums.length costs.length
n
nums[i], costs[i]