#C13875. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
You are given a string \(s\) consisting of letters, digits, spaces, and special characters. Your task is to find the first character in the string that does not repeat anywhere else. If every character repeats or if the string is empty, output an underscore _
.
Note: The check is case-sensitive, meaning that upper-case and lower-case letters are considered distinct.
For example, if \(s = \texttt{abacabad}\), the first non-repeating character is c
.
inputFormat
The input consists of a single line containing the string \(s\). This string may include letters, digits, spaces, and punctuation.
outputFormat
Output a single character: the first non-repeating character in the string. If no such character exists, output an underscore _
.
abacabad
c