There is an startPos homePos
At each step, the robot can move one cell up, down, left, or right. The cost of each movement depends only on the target cell:
Moving into any cell in row rowCosts[r].
Moving into any cell in column colCosts[c].
The robot does not pay any cost for its starting cell.
Return the minimum total cost for the robot to move from startPos to homePos.
Constraints:
m rowCosts.length
n colCosts.length
rowCosts[r], colCosts[c]
startPos.length
homePos.length
There is an startPos homePos
At each step, the robot can move one cell up, down, left, or right. The cost of each movement depends only on the target cell:
Moving into any cell in row rowCosts[r].
Moving into any cell in column colCosts[c].
The robot does not pay any cost for its starting cell.
Return the minimum total cost for the robot to move from startPos to homePos.
Constraints:
m rowCosts.length
n colCosts.length
rowCosts[r], colCosts[c]
startPos.length
homePos.length