You are given a string text and a list of words blocked.
Your task is to find the most frequent word in the text that is not included in the blocked list.
The search should be case-insensitive, and punctuation symbols (such as ,, ., !, ?, etc.) should be ignored.
The result must be returned in lowercase.
It is guaranteed that at least one non-blocked word exists and that the answer is unique.
Input: text = "John played football, then john PLAYED cricket! Played again." blocked = ["played"]
Output: "john"
Input: text = "Rain rain go away!" blocked = ["rain"]
Output: "go"
Accepted:
Submission: