[파이썬 알고리즘 인터뷰] 가장 흔한 단어
# 4. 가장 흔한 단어 금지된 단어를 제외한 가장 흔하게 등장하는 단어를 출력하라. 대소문자 구분을 하지 않으며, 구두점(마침표, 수미표 등) 또한 무시한다 * 입력: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit." banned = ["hit"] * 출력 "ball" paragraph = "Bob hit a ball, the hit BALL flew far after it was hit." banned = ["hit"] import re import collections def common_word(paragraph): words=[word for word in re.sub(r'[^\w]'," ",paragraph).lower..
2020.12.24