#K62107. Merge Unique Characters
Merge Unique Characters
Merge Unique Characters
Given a list of strings, your task is to merge them into one string containing all distinct characters. Specifically, for each string in the list, determine the set of characters it contains, take the union of these sets across all strings, and finally sort the resulting set in lexicographical order (i.e., ascending order as defined by the ASCII values). Formally, if there are \( n \) strings \( s_1, s_2, \dots, s_n \), output the string formed by sorting the set \( \bigcup_{i=1}^{n} \{ characters\ in\ s_i \} \).
inputFormat
The input is provided via standard input (stdin) and has the following format:
n s1 s2 ... sn
Here, the first line contains a non-negative integer \( n \) representing the number of strings. Each of the following \( n \) lines contains a non-empty string.
outputFormat
Output a single line via standard output (stdout) containing the merged string of unique characters in sorted order.
## sample4
abc
de
a
f
abcdef