Given a string paragraph and an array of banned words banned, return the most frequent word that is not banned.
The words in paragraph are case insensitive, and the returned result must be in lowercase. Punctuation symbols in paragraph are ignored. It is guaranteed that there is at least one word that is not banned, and the answer is unique.
Constraints:
paragraph.length
paragraph consists of English letters, space ' ', or one of the symbols: "!?',;.".
banned.length
banned[i].length
banned[i] consists of only lowercase English letters.
Given a string paragraph and an array of banned words banned, return the most frequent word that is not banned.
The words in paragraph are case insensitive, and the returned result must be in lowercase. Punctuation symbols in paragraph are ignored. It is guaranteed that there is at least one word that is not banned, and the answer is unique.
Constraints:
paragraph.length
paragraph consists of English letters, space ' ', or one of the symbols: "!?',;.".
banned.length
banned[i].length
banned[i] consists of only lowercase English letters.