목록뉴스 클러스터링 (1)
컴공생의 다이어리

[프로그래머스] 뉴스 클러스터링 - 파이썬(Python) from collections import Counter def solution(str1, str2): # 소문자로 변경 str1, str2 = str1.lower(), str2.lower() # 문자열 조각들 만들기 str1_set = list(str1[i:i + 2] for i in range(len(str1) - 1) if str1[i:i + 2].isalpha()) str2_set = list(str2[i:i + 2] for i in range(len(str2) - 1) if str2[i:i + 2].isalpha()) # 문자열 조각들 세기 str1_counter, str2_counter = Counter(str1_set), Counter..
Development/Algorithm & Coding Test
2022. 6. 18. 00:01