#C10351. First Unique Character

    ID: 39547 Type: Default 1000ms 256MiB

First Unique Character

First Unique Character

You are given a string s. Your task is to find the first character in s that occurs exactly once. If every character in s repeats or if the string is empty, you should output an empty string.

More formally, let s be a string of characters. Find the smallest index i such that the frequency of s[i] in s is 1. If no such index exists, output an empty string.

Examples:

  • For s = "swiss", the answer is w.
  • For s = "teeter", the answer is r.
  • For s = "aabb", the answer is an empty string.

Note: If there is no non-repeating character, print nothing.

inputFormat

The input consists of a single line containing the string s. The string may contain spaces and can be empty.

Input format:

<string s>

outputFormat

Print the first non-repeating character of the string. If no such character exists, output an empty string.

Output format:

<result character or empty>
## sample
swiss
w