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.
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Reverse a StringEasy · java, python, c, cpp, javascriptSolve Problem
- Check PalindromeEasy · java, python, c, cpp, javascriptSolve Problem
- Count Vowels and ConsonantsEasy · java, python, c, cpp, javascriptSolve Problem