#C2360. First Non-Repeating Character

    ID: 45668 Type: Default 1000ms 256MiB

First Non-Repeating Character

First Non-Repeating Character

Given a string s, your task is to find the first non-repeating character in the string. In other words, identify the first character that appears exactly once.

If every character in s repeats, print None.

The input will be provided via standard input (stdin) and the output should be printed to standard output (stdout).

Example:

  • If s = "swiss", then the first non-repeating character is w.
  • If s = "programming", then the first non-repeating character is p.
  • If s = "aabbcc", then there is no non-repeating character, so the output is None.

The approach involves counting the occurrences of each character and then identifying the first one with exactly one occurrence.

Formally, if you denote the string as s and the operation to count the occurrence as cnt(x), you need to find the smallest index i such that cnt(s[i]) = 1. If no such index exists, output None.

Note: In your solutions, if there isn't any non-repeating character, make sure to output the string None (without quotes).

inputFormat

The input consists of a single line containing the string s.

The string may include letters, digits, and other characters.

outputFormat

Output the first non-repeating character of the string. If no such character exists, output None.

## sample
swiss
w

</p>