Problems > Grid Walk > Editorial

Grid Walk — Solution & Editorial

Back to the Problem

Keep two counters and update them per character.

Complexity: O(|S|)