Search
⌘K

Leetcode 3603. Minimum Cost Path with Alternating Directions II

Find the minimum total cost to reach (m-1,n-1) on an m×n grid where you alternate between moving (only right or down on odd-numbered seconds) — paying each entered cell’s entry cost (i+1)*(j+1) — and mandatory 1-second waits on even-numbered seconds that incur waitCost[i][j]; treat time-parity as part of state and compute a shortest-path/DP over (i,j,parity).


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.