Loading...
Loading...
Loading...
In a line of text, find the first character that appears exactly once. Spaces count as characters, but the text has no spaces.
Print that character, or None if every character repeats.
None.Example
Input
swiss
Output
w
w is the first letter that appears only once.
Try the problem first. Open one hint at a time.
A first pass can count every character. A second pass can look for the first count of 1.
Scan the text itself in order for the second pass, not the dictionary, so the first position wins.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor