#C12407. First Non-Repeating Character
First Non-Repeating Character
First Non-Repeating Character
Given a string ( s ), the task is to find the first character in ( s ) that does not repeat. In other words, find the smallest index ( i ) such that the frequency of ( s[i] ) is exactly 1. If no such character exists (i.e., if all characters repeat) or if the string is empty, output 'None'.
Note: The frequency of a character is defined as the number of times it appears in the string. Use efficient techniques to ensure optimal performance for larger strings.
inputFormat
A single line containing the string ( s ). The string may include letters, digits, and special characters. There will be no extra spaces at the beginning or end of the input.
outputFormat
Print a single line containing the first non-repeating character of ( s ). If no such character exists, print 'None'.## sample
swiss
w