cswork / OAOpen practice workspace

SalesforceOA #4

Spam Classification

Estimated EasyStatement and editorial — judging is being prepared

Topics (AI-labelled)StringsHashing

给一组文本 texts 和一组小写关键词 spamWords。对每条文本,若包含任意一个 spamWords(大小写不敏感、整词匹配)则标记 "spam",否则 "not_spam",按原顺序返回结果数组。

Example 1

Input:

texts = ["Free prize worth millions", "Ten tips for a carefree lifestyle"]
spamWords = ["free", "money", "win", "millions"]

Output:

["spam", "not_spam"]

Explanation: :)

Editorial

Loading solution…