First Non-Repeating Character
Easyjavapythonccppjavascript
Find the first character in a string that appears exactly once. At least one such character is guaranteed to exist.
Input Format
A single line containing the string S with no spaces.
Output Format
Print the first non-repeating character.
Example 1
Input
swiss
Output
w
Explanation: w occurs only once and appears before every other non-repeating character.
- 1 <= length of S <= 100000
- S consists of lowercase English letters.
- At least one non-repeating character exists.