![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmAMDE%2Fbtr1udX8SNe%2F1RBJiS7OYaWPlxomPxNLV1%2Fimg.png)
LeetCode-819 Most Common Word : 금지된 단어를 제외한 가장 많은 빈도의 단어 추출 Info : 대소 문자, 구두점 무시class Solution: def mostCommonWord(self, paragraph: str, banned: List[str]) -> str: return Counter([word for word in re.sub("[^a-z]", ' ',paragraph.lower()).split() if word not in banned]).most_common(1)[0][0] Result : 28 Memory: 13.9mb