728x90 반응형 ‼ ERROR RECORD40 Leetcode 662. Maximum Width of Binary Tree (BFS level order) https://leetcode.com/problems/maximum-width-of-binary-tree/ Maximum Width of Binary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 다시 만난 Binary Tree 문제입니다. 이진트리의 레벨에서 최대 길이(시작 노드에서 끝노드까지의 개수)를 찾는 문제입니다. 처음에 level order traversal 임을 파악하고 BFS로 접근을 시도했는데요, 어떻게 길이의 정의를 코드화시킬 수 .. 2022. 10. 29. Leetcode 189. Rotate Array (O(1) 제약조건) https://leetcode.com/problems/rotate-array/ Rotate Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 이 문제는 간단해 보이지만 O(1)의 공간을 이용해서 풀어야 하는 문제였습니다. 즉, 별도의 공간을 할당해서 임시로 값을 저장하는 장치 같은것은 사용하지 말라는 문제였는데요 저는 처음에 deque.rotate() 를 이용해서 풀다가 nums 에 in-place로 접근해야 하는 것을 깨닫고 헤맸던 문제였습니다. R.. 2022. 10. 27. Leetcode 24. Pathsum2 (DFS, Backtracking) https://leetcode.com/problems/path-sum-ii/ Path Sum II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 네,,, 다시 만난 백트래킹 문제로 이진트리에서 root에서 leaf노드까지 갔을 때의 경로합이 targetSum에 해당하는 path를 전부 반환하는 문제입니다. 여러 시행착오와 다른 분들 자료를 참고하면서 답변을 짜봤습니다 재귀 DFS 방법 ) # Definition for a binary tree node. # .. 2022. 10. 26. Leetcode 24. Swap nodes in Pairs https://leetcode.com/problems/swap-nodes-in-pairs/ Swap Nodes in Pairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 오랜만에 만난 linked list 의 문제입니다. Linked list 관련 개념과 문제들은 아래에서 참고 가능합니다 2022.09.28 - [‼ ERROR RECORD] - Leetcode 19. Remove Nth node from end of the list (Linked List.. 2022. 10. 25. Leetcode 211. Design Add and Search Words(Trie+DFS) https://leetcode.com/problems/design-add-and-search-words-data-structure/ 오랜만에 만난 Trie 문제입니다 Trie 기본 개념과 관련 다른 문제는 아래에서 볼 수 있습니다. 2022.10.03 - [‼ ERROR RECORD] - Leetcode 139. Word Break (Trie, BFS, DP) 2022.09.27 - [Data Structure & Algorithm] - Trie (트라이, Digital tree, prefix, Retrieval tree) + 예제 코드 이번에 문제를 풀어보니 Trie 문제를 풀때 어느정도 기본 코드 구조가 있는 것 같습니다. 여러 코드를 보면서 어떤 식으로 풀이가 가능한지 보겠습니다. Trie Chil.. 2022. 10. 20. Leetcode 310. Minimum Height Trees https://leetcode.com/problems/minimum-height-trees/ Minimum Height Trees - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제를 보고 바로 전에 풀었던 Course schedule topological sort 문제가 생각났는데요 2022.09.23 - [‼ ERROR RECORD] - Leetcode 207. Course Schedule 풀이 (Topological Sorting, BFS, DFS) L.. 2022. 10. 11. 이전 1 2 3 4 5 ··· 7 다음 728x90 반응형