hash2 ★★★ 해시 - 베스트앨범 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/42579 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(genres, plays): x = len(genres) dict_music = {} dict_list = {} answer = [] for i in range(x): gen = genres[i] if gen not in dict_music.keys(): dict_music[gen] = plays[i] dict_list[gen] .. 2025. 1. 15. ★★ 해시 - 전화번호 목록 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/42577 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr from collections import Counterdef solution(phone_book): # hash를 dict로 만드는 방법 1 hash_phone = {} for phone in phone_book: hash_phone[phone] = 0 # hash를 dict로 만드는 방법 2 # hash_phone = Counter(phone_book) for phone in.. 2025. 1. 15. 이전 1 다음