Most Common Word, is a LeetCode problem. In this post we will see how we can solve this challenge in Python

Problem Description

Words in the list of banned words are given in lowercase, and free of punctuation. Words in the paragraph are not case sensitive. The answer is in lowercase.

Example:

Input: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit." banned = ["hit"] Output: "ball" Explanation: "hit" occurs 3 times, but it is a banned word. "ball&quo ....

You can find the full details of the problem Most Common Word at LeetCode

Solution: Please check the main.py snippet for the solution.

This solution originally posted at: Github by @kamyu104