3295. Report Spam Message Medium

@problem@discussion
#Array#Hash Table#String



1/**
2 * [3295] Report Spam Message
3 *
4 * You are given an array of strings message and an array of strings bannedWords.
5 * An array of words is considered spam if there are at least two words in it that exactly match any word in bannedWords.
6 * Return true if the array message is spam, and false otherwise.
7 *  
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">message = ["hello","world","leetcode"], bannedWords = ["world","hello"]</span>
11 * Output: <span class="example-io">true</span>
12 * Explanation:
13 * The words "hello" and "world" from the message array both appear in the bannedWords array.
14 * </div>
15 * <strong class="example">Example 2:
16 * <div class="example-block">
17 * Input: <span class="example-io">message = ["hello","programming","fun"], bannedWords = ["world","programming","leetcode"]</span>
18 * Output: <span class="example-io">false</span>
19 * Explanation:
20 * Only one word from the message array ("programming") appears in the bannedWords array.
21 * </div>
22 *  
23 * Constraints:
24 * 
25 * 	1 <= message.length, bannedWords.length <= 10^5
26 * 	1 <= message[i].length, bannedWords[i].length <= 15
27 * 	message[i] and bannedWords[i] consist only of lowercase English letters.
28 * 
29 */
30pub struct Solution {}
31
32// problem: https://leetcode.com/problems/report-spam-message/
33// discuss: https://leetcode.com/problems/report-spam-message/discuss/?currentPage=1&orderBy=most_votes&query=
34
35// submission codes start here
36
37impl Solution {
38    pub fn report_spam(message: Vec<String>, banned_words: Vec<String>) -> bool {
39        false
40    }
41}
42
43// submission codes end
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn test_3295() {
51    }
52}
53


Back
© 2025 bowen.ge All Rights Reserved.