Last Updated: 8 Oct, 2025

Single Occurrence Characters

Easy

Problem statement

You are given a string S. Your task is to process the string and identify all characters that appear exactly once.


From these unique characters, you must construct and return a new string. The characters in this new string must be ordered according to their first appearance in the original input string S.


If no character in the string S appears exactly once, you should return an empty string.


Input Format:
The first and only line of input contains a single string S.


Output Format:
Print a single string containing all characters that appear exactly once, sorted by their first appearance in the input string.

If no such character exists, print an empty string (a new line).


Note:
The character comparison is case-sensitive. For example, 'a' and 'A' are considered two different characters.

The input string can contain any standard ASCII characters, including letters, numbers, symbols, and spaces.