Keep First of Each Letter
Return s with every repeated character removed, keeping only the first time each character appears. The remaining characters stay in their original order.
Example 1
s "banana"
returns "ban"
First b, a, n are kept: ban.
Constraints
0 <= len(s) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Hash maps problems
- Letter Count TableBeginner
- Matching Sock PairsBeginner
- Translate With a GlossaryBeginner
- Unfilled OrdersBeginner
- Check If N and Its Double ExistEasy
- Closest Pair of Equal ValuesEasy
- Consistent Code BookEasy
- Degree of an ArrayEasy