Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use shortest path algorithms with a state for the last move being odd or even indexed.
Solve with full IDE support and test cases