전체 글

전체 글

    9/29 (금) 순회 결과로부터 역으로 트리 구하기 TIL

    공부한 것LeetCode #105. Construct Binary Tree from Preorder and Inorder TraversalLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/이진 트리의 전위와 중위..

    9/28 (목) leetcode-cli를 해부 중2 TIL

    공부한 것Typescript의 키워드 declare와 namespace에 대하여 (속시원하진 않음)Javascript에서 Plugin.prototype.init() 과 Plugin.init()의 차이에 대하여 (속시원하진 않음)leetcode-cli 패키지의 코드 중 plain text로 표현될 만한 부분을 전부 떼어서 helper.js의 helper 객체에 떼려부어 놓은 형태가 흥미로웠다. 아니, 사실 약이 잔뜩 올랐다. 이 변수가 어떤 걸 뜻하는지 실마리를 찾아서 이 파일에 도달하면 또 저 파일의 메소드 결과값이라고 하고, 찾아가면 또 다른 파일을 찾아가야 하고, 그렇게 도달한 게 이름만으로는 전혀 연관있어 보이지도 않는 helper.js였다니… 그래도 마침내 끝에 도달했다는 점에서 만족스러웠다.알게..

    9/27 (수) leetcode-cli를 해부 중 TIL

    공부한 것유닉스(Unix)와 유닉스 계통(Unix-like) 운영체제의 종류와 역사에 대하여유닉스에는 유전적, 상표, 기능적 유닉스가 있다고 볼 수 있고 그 중 리눅스(Linux)는 유닉스 계통(Unix-like), 기능적 유닉스의 대표이고 맥(MacOS)는 유전적+상표 유닉스의 대표라고 할 수 있다. CLI 패키지 구성 중 bin폴더와 셔뱅(shebang)에 대하여 진행 중leetcode-cli 패키지의 구조를 살펴보고 있다. 궁극적으로는 로그인을 하고 leetcode API에서 문제 등의 정보를 어떻게 받아오는지를 알아내는 것이 목표. 문제 정보를 받아올 수 있다면, 이용자의 개인 제출 기록도 받아올 수 있을까, API로 제공되는 부분에 해당하지 않아서 아예 불가능할까? 지금은 공부법 과도기. 손으로..

    9/26 (화) 이진 트리 후위 순회 구현 TIL

    공부한 것LeetCode #145. Binary Tree Postorder TraversalLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/binary-tree-postorder-traversal/description/후위 순회(Postorder traversal): ‘나’와 두 자식을 기준으로, “왼 자식 → 오른 자식 → 나” 순..

    9/25 (월) 이진 트리 전위 순회와 중위 순회 구현하기 TIL

    공부한 것LeetCode #144. Binary Tree Preorder TraversalLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/binary-tree-preorder-traversal/description/전위 순회(Preorder traversal): ‘나’와 두 자식을 기준으로, “나 → 왼 자식 → 오른 자식” 순으로 ..

    9/22 (금) 단어 검색II 문제를 Trie로 업그레이드하다 TIL

    공부한 것LeetCode #212. Word Search IILeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/word-search-ii/description/ Trie 클래스를 구현해서 풀었다. 기존에 알던 구현 형식에 나름 변형을 가했는데 잘 풀렸다. 세 번의 서로 다른 시도 끝에(로직은 통과가 됐었다) 다른 사람의 풀이를 참고해서..

    9/21 (목) 불렛 저널: 기록을 집대성할 방법을 찾다 TIL

    불렛 저널(Bullet Journal)불렛 저널이라는 것을 알게 되었다. 책으로 접했다. 블로그에 포스팅하는 체계에 대해 생각이 많아진다. 데일리 로그를 하루 중 아무 때나 기록하면, 그걸 하루 마감 시간 혹은 다음날 아침 시간에 옮겨적고 정리한다. 손으로 쓰는 것이 핵심이다. 두 번 쓸 번거로움을 무릅쓸 가치가 있는 것만이 정리되어 남게 되고, 그것을 색인으로 묶는다. 그러니까, 이제부터 노트 정리는 전부 손으로 써서 정리하기로 정한다. 가능하면 그렇게 하자. 블로그에 올리는 TIL은 정리한 데일리 로그 중 뽑아 적는다. 그리고 이거야말로 내가 하고 싶은 건데, 대학원 공돌이가 쓴 것 같은 기술 글이나 레포트같이 넓고 얕게 잘 정리한 글도 간간이 써서 올리는 걸 도전하고 싶다. 불렛 저널 시스템에서 하..

    9/20 (수) Bitwise NOT으로 Math.floor() 대체하기 TIL

    공부한 것LeetCode #212. Word Search IILeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/word-search-ii/description/보조 재귀함수를 구현하였다. 해결해야 할 것: 첫 문자가 어느 칸에 나오는지를 찾아갈 수 있게 만들기. 한 단어가 같은 칸을 두 번 가지 못하도록 수정하기(사실 이건 거의 구현했..

    9/19 (화) leetcode-cli가 거의 무용함이 드러나다 TIL

    구상 중문제풀이 코드 제출 후 실행 결과를 여러 개 모아서 소요 메모리와 시간 추이를 시각화하기: 로그인한 유저의 정보 중 submissions 정보에 접근하는 방법으로 leetcode-cli 라이브러리를 이용하기: 일단 유저 로그인은 전에 정리했던 대로 접근했고,그런데 아뿔싸 leetcode-cli의 submission 기능을 살펴봤지만 (명령어: leetcode submission 347 -o "leetsubmission") 마지막 제출한 답안을 코드 파일로 다운받는 기능일 뿐이었다. 문제를 불러올 때(show)와 제출할 때 typescript 언어를 고를 수도 없다. 문제 불러오기 명령어: $leetcode show 212 -gxe -l javascript조금 더 사용해보다가 로그인 기능만 따오고 ..

    9/18 (월) 와일드카드(.)를 포함한 단어를 검색할 수 있는 Trie 클래스 TIL

    공부한 것LeetCode #211. Design Add and Search Words Data StructureLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/design-add-and-search-words-data-structure/description/=> 오늘은 조금 다른 형태의 Trie(트라이) 클래스 구현체를 보았다. 이전..

    9/15 (금) Trie 클래스를 구현해보다 TIL

    공부한 것LeetCode #208. Implement Trie (Prefix Tree)LeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/implement-trie-prefix-tree/description/=> Trie(트라이) 클래스를 구현하였다. 내가 만든 1차원 배열을 이용한 해답과 달리 실제로는 거의 무한히 중첩되는 배열을 사용..

    9/14 (목) Jest에서 모킹(Mocking)하는 3가지 방법 **_+ VS Code에 컬러풀 주석 세팅하기_** TIL

    공부한 것LeetCode #208. Implement Trie (Prefix Tree)LeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/implement-trie-prefix-tree/description/=> Trie(트라이) 자료구조를 구현하는 문제다. Trie가 어떤 것인지 모르고 일단 구현하라는 대로는 해서 테스트에 통과하긴 했..

    9/13 (수) BFS를 이용한 한 문제 풀이와 바뀐 LeetCode 레이아웃 TIL

    공부한 것LeetCode #199. Binary Tree Right Side ViewLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/binary-tree-right-side-view/=> 주어진 이진 트리를 오른쪽으로 뉘여서 보았을 때 가장 윗면에 노출되는 노드를 root쪽부터 순서대로 배열에 담아서 반환하는 문제다. = 주어진 트리..

    9/12 (화) 재귀를 스스로 풀다 TIL

    공부한 것LeetCode #1448. Count Good Nodes in Binary TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/count-good-nodes-in-binary-tree/⇒ 어제에 이어서 스스로 풀어본 해답이 통했다! (스택을 이용한 해답은 다른 사람들의 해답을 참고함.) 재귀를 이용한 DFS도, 스택을 ..

    9/11 (월) 트리 심화 TIL

    공부한 것LeetCode #1448. Count Good Nodes in Binary TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/count-good-nodes-in-binary-tree/ Uploaded by N2T

    9/8 (금) 이진 탐색 트리(BST)인지 검증하라 TIL

    공부한 것LeetCode #98. Validate Binary Search TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/validate-binary-search-tree/description/재귀함수가 이렇게 간단한 형태가 될 수도 있다: function isValidBST(root: TreeNode | null, min ..

    9/7 (목) 이진 탐색 트리(BST)의 특징을 이용한 문제 TIL

    공부한 것LeetCode #235. Lowest Common Ancestor of a Binary Search TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/description/BST는 부모 노드의 값이 왼쪽 서브트리에 있는 모든 노드의 값..

    9/6 (수) 계속하여 재귀함수 TIL

    공부한 것LeetCode #543. Diameter of Binary TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/diameter-of-binary-tree/description/트리의 최대 깊이를 구하는 문제에 살짝 변주를 준 문제였다. Uploaded by N2T

    9/5 (화) 재귀함수와 백트래킹 TIL

    9/5 (화) 재귀함수와 백트래킹 TIL

    공부한 것오늘은 재귀함수에 대한 유튜브 강의를 듣다가 백트래킹(Backtracking)이라는 용어가 나오길래 정확히 어떤 건지 궁금하여 찾아보았다. 백트래킹(Backtracking, 퇴각검색)길이 여러 갈래로 나뉘어진 재귀호출이다. 가능한 모든 경우의 수를 낱낱이 탐색할 때 사용한다. 주로 다음과 같은 경우에 백트래킹을 적용한다: 일정한 크기의 조건들이 주어지고, 그 안에서 완전탐색을 통해 최적비용 또는 최적경로를 탐색해야 하는 경우.각 조건에서 선택할 수 있는 경우의 수가 정해져 있을 경우 (이차원 배열 등)예제 1) 주사위 던지기: 주사위를 N개 던져서 나올 수 있는 경우의 수를 모두 출력하기코드: // 주사위를 N번 던진 결과의 모든 조합을 배열 형태로 출력하기. // 예를 들어 3번 던진 결과는 ..

    9/4 (월) VS Code 커스텀 단축키 만들기 TIL

    9/4 (월) VS Code 커스텀 단축키 만들기 TIL

    VS Code 단축키 설정 이전 단축키 모음: 2/9 목 (Nest.js 진입, Visual Studio Code로도 첫 진입) TIL(Nest.js 공부 시작)처음으로 Nest.js를 소개 받았다. 일단 프레임워크이고, 제어 역전이 일어났다는 점에서 라이브러리와 다르며, 알아서 코드 틀을 짜주고 폴더 구조를 잡아준다. 데코레이터 클래스라는 이름표들을 나에게 쥐어주고 ‘넌 네 가내수공업 코드에 내가 준 이름표를 붙여놓기만 해, 가져다 쓰는 건 내가 한다’ 하는 적극적이고 주도적인 성격. 폴더와 파일 틀을 척척 짜주는 면에서 자신감이 돋보인다. 라이브러리를 비롯해 내가 기존에 알고 지내던 군상과는 또 결을 달리하는 친구임이 분명하다. 개인적인 소감으로는, IoC(제어 역전)이 되면 모듈간 결합도가 낮아지고..