Warm-ups · 17 of 24
Remove duplicate characters, keep the first
Return the string with repeated characters removed, keeping each character's first occurrence in order.
Examples
Input s = "programming"
Output "progamin"
Input s = "aaaa"
Output "a"
📘 New to this? A set for “have I seen this?” explains the idea in a few minutes.