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.
The first and only line of input contains a single string S.
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).
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.
statistics
ac
Count character frequencies: 's': 3, 't': 3, 'a': 1, 'i': 2, 'c': 1.
Identify characters that appear once: 'a' and 'c'.
Order them by first appearance: In "statistics", 'a' appears before 'c'.
The final output is ac.
hello world
he wrd
Count character frequencies: 'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1.
Identify characters that appear once: 'h', 'e', ' ', 'w', 'r', 'd'.
Order by first appearance: The result is constructed by picking these characters in their original order from "hello world".
The final output is he wrd.
The expected time complexity is O(N).
1 <= length of S <= 10^6
The string S contains standard ASCII characters.
Time limit: 1 sec