Algorithm · Whatnot · Easy
Given the arrays messages and unsafeWords, each message is a two-element array [username, text]. A message is unsafe when its text contains at least one unsafe word. Return only the messages whose text contains no unsafe word, preserving the original order. Words are matched using these rules: A word is a maximal sequence of characters delimited by spaces; punctuation is part of the word, so "Nintendo," and "Nintendo" are distinct words. Matching is case-insensitive:…
Checking your access…