Two Words

Limits 1s, 512 MB

Given a line of text (space-separated words), find the first word that appears at least twice in the text.

This is a companion discussion topic for the original entry at

In the output section of this problem it says, “You may output the word in any letter case.”. But outputting “The” instead of “the” results in WA as shown here: submission 1, submission 2. Is it a problem in the my solution or the problem’s checker?