#C257. Hashtag Validator
Hashtag Validator
Hashtag Validator
You are given a list of strings representing hashtags. A valid hashtag must satisfy the following conditions:
- It starts with the symbol \(\#\).
- It has at least one alphanumeric character following the \(\#\).
- All characters after the \(\#\) are alphanumeric (i.e. letters or digits).
- No hashtag appears more than once.
Your task is to determine if the list of hashtags is valid. If the list is valid, output True
; otherwise, output False
.
inputFormat
The input is provided via standard input (stdin) and consists of:
- An integer \(n\) (\(n \ge 0\)) — the number of hashtags.
- \(n\) lines, each containing a hashtag (a non-empty string).
outputFormat
Output a single line: True
if the list of hashtags is valid under the rules, otherwise False
.
3
#love
#sunshine
#123
True
</p>