Problems > Keep First Occurrences > Editorial

Keep First Occurrences — Solution & Editorial

Back to the Problem

Track a seen-set while scanning; output characters not seen before.

Complexity: O(|S|)