Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- JavaScript
- maeil-mail
- react-redux
- redux
- 코딩테스트합격자되기
- 알고리즘
- axios
- SW
- redux-saga
- sw expert academy
- 자바
- useDispatch
- 이코테
- 프로그래머스
- C++
- java
- 매일메일
- Python
- redux-toolkit
- 테코테코
- json-server
- react-router
- react
- Algorithm
- 항해99
- createSlice
- 항해플러스
- 리액트
- Get
- programmers
Archives
- Today
- Total
Binary Journey
[프로그래머스] 위장 본문
반응형
출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges
def solution(clothes):
categories = dict()
spi_woredrobe = dict()
answer = 1
for c in clothes:
if not c[1] in spi_woredrobe:
spi_woredrobe[c[1]] = set()
categories[c[1]] = 0
if not c[0] in spi_woredrobe[c[1]]:
spi_woredrobe[c[1]].add(c[0])
categories[c[1]] += 1
for val in categories.values():
answer *= (val + 1)
return answer - 1
반응형
'프로그래머스 > level 2' 카테고리의 다른 글
[프로그래머스] 전화번호 목록 (0) | 2022.04.21 |
---|---|
[프로그래머스] 삼각달팽이 (0) | 2022.04.21 |
[프로그래머스] 더 맵게 (0) | 2022.04.20 |
[프로그래머스] 조이스틱 (0) | 2022.03.10 |
[프로그래머스] 가장 큰 수 (0) | 2022.03.10 |