words, and the list banned holds forbidden words.
The message counts as **spam** when at least two of its words (two positions in the array) exactly match some word in banned. The same banned word showing up twice also counts as two matches.
Return True if the message is spam and False otherwise.words=['win', 'a', 'free', 'cruise'], banned=['free', 'win', 'prize'] → True
The message holds two banned words, "win" and "free", so it is spam.
words=['see', 'you', 'at', 'lunch'], banned=['lunch', 'prize'] → False
Only one banned word, "lunch", appears, which is not enough.
words=['cash', 'now', 'cash'], banned=['cash'] → True
Words of the message are counted, not distinct banned words: "cash" appears twice, so the message is spam.
len(words), len(banned) ≤ 10⁵words=['win', 'a', 'free', 'cruise'], banned=['free', 'win', 'prize']
True
Run checks the first 3 tests in your browser. Submit checks all 96 tests on the server, hidden ones included.