Challenge: First Unique Letter

Lab Python Beginner 10 points

Read a word and print the first letter that appears only once in it, or none.

Input

One word.

Output

A single letter, or none.

Example

Input

leetcode

Output

l
Sample input available Sample output available
Editor
Python

Hints

Count every letter first.

Then walk the word again and stop at the first letter with count 1.

Solution explanation

Two passes over the word: O(n).

Show solution
from collections import Counter
s = input().strip()
c = Counter(s)
for ch in s:
    if c[ch] == 1:
        print(ch)
        break
else:
    print("none")
Output
Answer
HOME LABS COMMUNITY DASHBOARD