Spam word repetition
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) -> boolExample 1
Input
is_word_spam("buy BUY buy")Output
True