#C14341. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
You are given a string s
which may consist of letters, digits, punctuation, and other symbols. Your task is to find the first character in the string that does not repeat. If all characters repeat or the string is empty, output No non-repeating character found
.
The solution should efficiently traverse the string and determine the first unique character, taking into account that the comparison is case-sensitive.
Formally, given a string \( s \) of length \( n \), find the minimum index \( i \) such that the frequency of \( s_i \) in \( s \) is 1. If no such index exists, output No non-repeating character found
.
inputFormat
The input is read from standard input (stdin
). It consists of a single line containing the string s
.
outputFormat
Print the first non-repeating character to standard output (stdout
). If no such character exists, print No non-repeating character found
.
a
a