#K90757. Duplicate Words Checker

    ID: 37823 Type: Default 1000ms 256MiB

Duplicate Words Checker

Duplicate Words Checker

You are given one or more paragraphs. For each paragraph, determine if it contains any duplicate words. Words are sequences of alphanumeric characters and are compared in a case-insensitive manner. Punctuation is ignored. If any word appears more than once in a paragraph, output (DUPLICATES); otherwise, output (UNIQUE).

inputFormat

The input begins with an integer (N) on the first line, indicating the number of paragraphs. Each of the following (N) lines contains one paragraph.

outputFormat

For each paragraph, output a single line containing either (DUPLICATES) or (UNIQUE), according to whether duplicate words are found.## sample

1
Hello world! This is a test paragraph.
UNIQUE

</p>