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 |
Tags
- print("""
- 파이썬 int()
- 파이썬 map 함수
- 개발자사이드프로젝트
- EnvCommandError
- vscode cp949
- Til
- 항해플러스
- 항해99
- 코딩부트캠프후기
- MomentumParameters
- cp949
- fatal:not a git repository
- 99클럽 #99일지 #코딩테스트 #개발자스터디 #항해 #til
- 개발자스터디
- 코딩테스트
- 파이썬
- 99일지
- 주니어개발자역량강화
- not a git repository
- print sep
- 주니어개발자멘토링
- 10430번
- 99클럽
- 백준
- 파이썬 sep
- 파이썬 |
- 파이썬 클래스
- 항해
- Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Archives
- Today
- Total
선발대
[스파르타] 99클럽 2기 코테스터디 28일차 TIL / leet 1282 본문
Leetcode: 1282. Group the People Given the Group Size They Belong To (링크)
class Solution:
def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]:
res = []
hm = defaultdict(list)
for person, groupSize in enumerate(groupSizes):
if groupSize in hm and len(hm[groupSize]) == groupSize:
res.append(hm[groupSize])
hm[groupSize] = []
hm[groupSize].append(person)
for li in hm.values():
if li: res.append(li)
return res
'스파르타코딩클럽 > 활동 내용' 카테고리의 다른 글
[스파르타] 99클럽 2기 코테스터디 30일차 TIL / leet 1529 (0) | 2024.06.18 |
---|---|
[스파르타] 99클럽 2기 코테스터디 29일차 TIL / leet 1286 (0) | 2024.06.17 |
[스파르타] 99클럽 2기 코테스터디 27일차 TIL / leet 2433 (0) | 2024.06.15 |
[스파르타] 99클럽 2기 코테스터디 26일차 TIL / leet 1476 (0) | 2024.06.14 |
[스파르타] 99클럽 2기 코테스터디 25일차 TIL / 순위 (0) | 2024.06.13 |
Comments