#C34. Extract Unique Hashtags
Extract Unique Hashtags
Extract Unique Hashtags
You are given a text string representing a social media post. A hashtag in the post is defined as a '#' character immediately followed by one or more alphanumeric characters (letters and digits). A hashtag ends when a non-alphanumeric character is encountered.
Your task is to extract all unique hashtags from the input post. The hashtags should be transformed to lowercase and the '#' character should be removed. Then, output the unique hashtags in lexicographically sorted order (i.e. alphabetical order) separated by a single space. If there are no hashtags, output an empty line.
Note: The hashtag extraction stops at the first non-alphanumeric character. For example, in the string "#C++", only "C" will be considered.
inputFormat
Input is read from standard input (stdin) as a single string representing the user's post. The post may include spaces, punctuation, and hashtags.
outputFormat
Output to standard output (stdout) the unique hashtags extracted from the post. The output should be a single line containing the hashtags in lowercase, sorted in lexicographical order and separated by a single space. If no hashtags are present, output an empty line.## sample
I love #coding and #python. #coding is great!
coding python