프로그래머스_위장_python
https://programmers.co.kr/learn/courses/30/lessons/42578 코딩테스트 연습 - 위장 programmers.co.kr clothes의 각 행은 [의상의 이름, 의상의 종류]로 이루어져 있습니다. 스파이는 하루에 최소 한 개의 의상은 입습니다. from collections import defaultdict def solution(clothes): answer = 1 c_type = defaultdict(int) #값을 저장하지 않으면 0이 됨. for a, b in clothes: c_type[b] += 1 for i in c_type: answer *= c_type[i]+1 return answer-1 [내코드] defaultdic - 존재하지 않는 키를 조회할..
2021.07.20