Company: Idfc_29march
Difficulty: medium
Spam Classifier Problem Description A classification system evaluates if given n texts are spam based on a list of k spam words. A text is labeled as "spam" if it contains at least two spam words. Each occurrence of a spam word in a text counts towards the total. The spam words are not case-sensitive. Implement a function that determines whether each text is "spam" or "not_spam". The function classifyTexts will take two inputs: string texts[n] : the texts to evaluate string spamWords[k] : the spam words The function should return an array of n strings, either "spam" or "not_spam" for each text. The function signature is: vector<string> classifyTexts(vector<string> texts, vector<string> spamWords) Examples Example 1: Input: texts = ["free prize worth millions", "ten tips for a carefree lifestyle"], spamWords = ["free", "money", "win", "millions"] Output: ["spam", "not_spam"] Explanation: For the text "free prize worth millions": The spam words "free" and "millions" are