#C8713. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
Given a string \(s\), your task is to find the first character that does not repeat in \(s\). Formally, find the first character \(c\) such that
\[
\text{count}(c)=1
\]
If no such character exists, output the underscore character '_'
.
For example, if \(s = \texttt{aabbccdde}\), then the first non-repeating character is 'e'
because all previous characters appear more than once.
inputFormat
The input consists of a single line containing the string \(s\). The string may contain any printable characters.
outputFormat
Output a single character — the first non-repeating character in \(s\). If there is no non-repeating character, output '_'
.
a
a