... The trickier part of the problem is define what you want to consider a unique "word" for the purpose of this application.
The simplest definition to code would be to split the text strings up using just the space character as the delimiter. Beyond that you would need to consider the handling of punctuation, special characters, numbers and case sensitivity. Your decision on how you want those handled could make the coding needed to parse "words" significantly more complex.