Ezvor

3596. Minimum Cost Path with Alternating Directions I

MediumMath Preparing judge… LeetCode
MathBrainteaser

Hints

Hint 1
There are only three grid sizes for which reaching (m - 1, n - 1) is possible under the move rules: m = 1, n = 1; m = 1, n = 2; m = 2, n = 1.