Problems > Count the Transitions > Editorial

Count the Transitions — Solution & Editorial

Back to the Problem

Compare each character with its predecessor.

Complexity: O(|S|)