FunctionRacerProblemsRace

Keep First of Each Letter

BeginnerHash mapsPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Hash maps problems