#C14930. Unique Words Counter
Unique Words Counter
Unique Words Counter
This contest problem requires you to write a program to count the number of unique words in a given string.
Words are defined as contiguous sequences of alphanumeric characters (i.e. letters and digits). The comparison is case-insensitive, meaning that Hello
, hello
, and HELLO
are considered the same word.
You can think of a word as any substring that matches the regular expression \(\b\w+\b\). Your task is to output the count of unique words found in the input.
inputFormat
The input is provided via standard input (stdin) as a single string which may contain spaces, punctuation, and newline characters.
outputFormat
Output the number of unique words as an integer to standard output (stdout).
## sampleHello world
2