[20251023] PGM / Lv2 / 튜플 / 이강현 #1206
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/64065
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
튜플이 주어짐.
이때 앞에서부터 하나씩 늘려가며 집합형태로 만듦
예를 들어 (2,1,2,4) 이런 튜플이 있으면 {2},{2,1},{2,1,2},{2,1,2,4} 이런식으로 만든다는거
튜플은 순서가 다르면 서로 다른데 집합은 순서가 달라져도 같은 집합임.
따라서 {2},{2,1},{2,1,2},{2,1,2,4} 나 {4,2,1,2},{2},{1,2},{1,2,2} 나 둘 다 모두 같은 튜플에서 나온거임.
그럼 역으로 집합들이 주어질때, 튜플을 구하는 것이 목적.
🔍 풀이 방법
그냥 나눠서 원소 개수 센다음에 내림차순 정렬하고 리스트 만들면 끝남.
⏳ 회고
ez