Code RoomSpam word repetition
EasyPrep Room Coding #591

Spam word repetition

CodingAlgorithms & data structuresEntry–Mid~10 min

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.

Implement
is_word_spam(message: str) → bool
Examples
in["buy BUY buy"]outtrue
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 10 min
InputExpectedGot
["buy BUY buy"]truenot run yetsample