henry / 4월 2주차 / 3문제 #1
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.
4월 2주차 알고리즘 풀이
작성 양식 : [플랫폼] 문제 제목 / 난이도 / 걸린 시간 / 링크
개인 회고
카드 짝 맞추기:단순히 "단일 출발지" => "단일 목적지" 류의 그래프 문제라고 생각하고 접근했다가 탈탈 털렸던 문제.
3종류의 카드를 어떻게 뽑을지, 1종류의 카드 2개 중에서 어떤 걸 먼저 뽑을지에 대한 경우의 수를 고려해야 했던 문제.
사라지는 발판:재귀 함수에 대해 제대로 배울 수 있었던 문제.
경우의 수를 따져나갈 때, 현재 재귀 함수의 실행 흐름이 정확히 어떤 의미인지 알 수 있었다.
재귀를 복귀하는 시점이 이미 그 다음 경우의 수를 전부 고려한 시점이므로 나와 상대방이라는 개념이 가능했다.
표 병합:여태까지 2차원 배열 형태로 그래프를 셋팅하면서 깊은 복사로 해본 적이 없었다.
다른 풀이에서는 union-find를 사용했는데, 카카오에서는 굳이 그럴 필요가 없다고 한 이유가 있었다.
부모까지 거슬러 올라가는 단계가 재귀함수가 필요할 만큼 깊지 않으므로 객체의 얕은 복사 개념만 잘 알고 있으면 merge 함수를 쉽게 구현할 수 있었던 문제였다.
다음주 계획