반응형
Recent Posts
Notice
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
- BOJ
- 큐
- python 10250
- Python
- python 10989
- 프로그래머스
- 코딩테스트 준비
- 파이썬
- python 14503
- 백준 팰린드롬수
- 일곱 난쟁이
- 구현
- python 2309
- softeer
- 백준 막대기
- python 1259
- BFS
- 항해99
- 개발자 취업
- 백준
- leetcode 2405
- Python 20001
- 99클럽
- leetcode
- 백준 2309
- 백준 카드1
- 스택
- til
- boj 2309
- 99항해
Archives
- Today
- Total
동까의 코딩
[99클럽] 27일차 TIL 본문
반응형
https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to/
class Solution:
def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]:
rst, dt = [], collections.defaultdict(list)
for i, g in enumerate(groupSizes):
dt[g].append(i)
if len(dt[g]) == g:
rst.append(dt[g])
dt[g] = []
return rst
반응형
'문제 풀이 > 99클럽' 카테고리의 다른 글
[99클럽] 29일차 TIL (0) | 2024.06.18 |
---|---|
[99클럽] 28일차 TIL (0) | 2024.06.17 |
[99클럽] 26일차 TIL (0) | 2024.06.16 |
[99클럽] 25일차 TIL (0) | 2024.06.14 |
[99클럽] 24일차 TIL (1) | 2024.06.14 |