#C10485. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
You are given a string s and your task is to find the first non-repeating character in it. A non-repeating character is defined as a character that appears exactly once in the string. If there is no such character, your program should output an underscore (_
).
The input is read from standard input (stdin) and the result must be written to standard output (stdout).
Note: When counting characters, consider the string in the order provided. Once a character is found that occurs exactly once, it should be immediately output. If no unique character exists, output _
.
inputFormat
The input consists of a single line string s.
Example:
aabbccdde
outputFormat
Output a single character which is the first non-repeating character in the string. If there is no such character, output _
.
Example:
e## sample
aabbccdde
e
</p>