Minimum Cost Path with Alternating Directions I
Each step must alternate between moving forward and moving back, and every entered cell costs its row and column product; a shortest-path search tracks the move parity.
Each step must alternate between moving forward and moving back, and every entered cell costs its row and column product; a shortest-path search tracks the move parity.