Spam word repetition

Write codeEasy10 min

Your task

A chat spam filter flags messages that are just one word repeated over and over. Given a message of words separated by single spaces (possibly empty), return True if the message consists of the same word repeated three or more times when compared case-insensitively, and False otherwise. For example, 'buy BUY buy' is spam, but 'buy buy' (only twice) and 'hello hello hello world' are not.

Examples

is_word_spam(message: str) -> bool
Example 1
Inputis_word_spam("buy BUY buy")
OutputTrue