#C12282. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
You are given a string text as input. Your task is to find the first character in the string that does not repeat. If every character in the string repeats or if the string is empty, output None
.
Note: The problem is case-sensitive, which means that uppercase and lowercase letters are considered distinct (for example, A
is different from a
).
For example:
- Input:
a
→ Output:a
- Input:
aabbc
→ Output:c
- Input:
aA
→ Output:a
- Input:
aabb
→ Output:None
Your program should read the input from standard input (stdin
) and print the answer to standard output (stdout
).
inputFormat
The input consists of a single line containing the string text.
outputFormat
Output a single line containing the first non-repeating character. If there is no such character, output None
.## sample
a
a