Loading...
Loading...
Loading...
A code is a word of lowercase letters. Print the first letter, reading from the left, that appears exactly once in the whole word. If every letter repeats, print NONE.
Example
Input
swiss
Output
w
w appears once and s three times, so the first letter that is unique is w.
Try the problem first. Open one hint at a time.
Count every letter first with a Counter. A second pass can then find the first count of 1.
The second pass must follow the word's order, not the order of the counter.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor