Problems > First Unique Character > Editorial

First Unique Character — Solution & Editorial

Back to the Problem

Count all frequencies first, then rescan for the first character with count 1.

Complexity: O(|S|)