Tap here to switch tabs
Problem
Submissions

Problem: Report Spam Message

Report Spam Message gives you a message and a list of banned words. Return true when at least two message words appear in the banned list; otherwise, return false.

Statement

You are given an array of strings message and an array of strings bannedWords.

An array message is considered spam if at least 22 of its words appear in bannedWords.

Return true if message is spam, and false otherwise.

Constraints:

  • 1≤1 \leq message.length, bannedWords.length ≤105\leq 10^5

  • 1≤1 \leq message[i].length, bannedWords[i].length ≤15\leq 15

  • message[i] and bannedWords[i] consist only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Report Spam Message

Report Spam Message gives you a message and a list of banned words. Return true when at least two message words appear in the banned list; otherwise, return false.

Statement

You are given an array of strings message and an array of strings bannedWords.

An array message is considered spam if at least 22 of its words appear in bannedWords.

Return true if message is spam, and false otherwise.

Constraints:

  • 1≤1 \leq message.length, bannedWords.length ≤105\leq 10^5

  • 1≤1 \leq message[i].length, bannedWords[i].length ≤15\leq 15

  • message[i] and bannedWords[i] consist only of lowercase English letters.