Problems > First Unique Character

First Unique Character

Difficulty: 1000 2000 ms 128 MB

strings

Print the first character that appears exactly once in S, or NONE if every character repeats.

Input: one line with the string S.

Output: the first non-repeating character, or NONE.

Constraints:

  • 1 ≤ |S| ≤ 104
  • S contains lowercase English letters

Sample Tests

Input 1
swiss
Output 1
w
Input 2
aabb
Output 2
NONE

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.