819

· One step
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
다했다
'819' 태그의 글 목록