Problems > Count a Given Character > Editorial

Count a Given Character — Solution & Editorial

Back to the Problem

Single pass comparing each character.

Complexity: O(|S|)