Til

    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조금 더 사용해보다가 로그인 기능만 따오고 ..

    5/24 수 [LeetCode #36] 유효한 스도쿠 TIL

    5/24 수 [LeetCode #36] 유효한 스도쿠 TIL

    [LeetCode] 36. Valid SudokuValid Sudoku - LeetCodeCan you solve this real interview question? Valid Sudoku - Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: 1. Each row must contain the digits 1-9 without repetition. 2. Each column must contain the digits 1-9 without repetition. 3. Each of the nine 3 x 3 sub-boxes of the gr..

    5/22 월 [LeetCode #347] K개의 최빈값 TIL

    5/22 월 [LeetCode #347] K개의 최빈값 TIL

    [LeetCode] 347. Top K Frequent ElementsTop K Frequent Elements - LeetCodeCan you solve this real interview question? Top K Frequent Elements - Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1], k = 1 Output: [1] Constraints: * 1

    5/19 금 [LeetCode #1] 투썸 TIL

    5/19 금 [LeetCode #1] 투썸 TIL

    [LeetCode] 1. Two SumTwo Sum - LeetCodeCan you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15..

    5/18 목 [LeetCode #242] 유효한 아나그램 TIL

    5/18 목 [LeetCode #242] 유효한 아나그램 TIL

    [LeetCode] 242. Valid AnagramValid Anagram - LeetCodeCan you solve this real interview question? Valid Anagram - Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: s = "anagram", t = "nagaram" Ou..

    5/12 금 [LeetCode #118] 파스칼의 삼각형 TIL

    5/12 금 [LeetCode #118] 파스칼의 삼각형 TIL

    [LeetCode] 118. Pascal's TrianglePascal's Triangle - LeetCodeCan you solve this real interview question? Pascal's Triangle - Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif] Example 1: Input: numRows ..

    5/10 수 [LeetCode #217] 배열에 중복되는 값이 있으면 true 반환하기 TIL

    5/10 수 [LeetCode #217] 배열에 중복되는 값이 있으면 true 반환하기 TIL

    [LeetCode] 217. Contains DuplicateContains Duplicate - LeetCodeCan you solve this real interview question? Contains Duplicate - Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3..

    5/9 화 [LeetCode #26] 순서를 유지하여 배열에서 중복 숫자 제거하기 TIL

    5/9 화 [LeetCode #26] 순서를 유지하여 배열에서 중복 숫자 제거하기 TIL

    [LeetCode] 26. Remove Duplicates from Sorted ArrayRemove Duplicates from Sorted Array - LeetCodeCan you solve this real interview question? Remove Duplicates from Sorted Array - Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such that each unique element appears only once. The relative order of the ele..

    5/9 화 [프로그래머스] 해시(Hash), 폰켓몬 TIL

    5/9 화 [프로그래머스] 해시(Hash), 폰켓몬 TIL

    [프로그래머스] 해시 > 폰켓몬 https://school.programmers.co.kr/learn/courses/30/lessons/1845나의 풀이: function solution(nums) { // nums / 2와, 폰켓몬 종류 수 중에서 // 폰켓몬 종류 수 10000) { console.log('nums의 길이가 10,000을 넘어갑니다'); return; } const map = new Map(); nums.forEach((type) =..

    4/25 화 (정규표현식) TIL

    정규 표현식 (Regular Expression): 문자열을 처리하는 방법 중의 하나로 특정한 조건의 문자를 '검색'하거나 '치환'하는 과정을 매우 간편하게 처리 할 수 있도록 하는 수단.: 문자열에서 특정한 문자를 찾아내는 도구.: 일정한 패턴을 가진 문자열의 집합을 표현하기 위해 사용하는 형식 언어. 문자열을 대상으로 패턴 매칭 기능을 제공함. 패턴 매칭 기능: 특정 패턴과 일치하는 문자열을 검색하거나 추출 또는 치환할 수 있는 기능. 예시) 유효한 휴대폰 전화번호인지 체크하기// 사용자로부터 입력받은 휴대폰 전화번호 const tel = '010-1234-567팔'; // 정규 표현식 리터럴로 휴대폰 전화번호 패턴을 정의한다. const regExp = /^\d{3}-\d{4}-\d{4}$/; //..

    4/25 화 [프로그래머스] 해시(Hash), 완주하지 못한 선수와 Object, Map의 시간복잡도 TIL

    4/25 화 [프로그래머스] 해시(Hash), 완주하지 못한 선수와 Object, Map의 시간복잡도 TIL

    [프로그래머스] 해시 > 완주하지 못한 선수 https://school.programmers.co.kr/learn/courses/30/lessons/42576나의 풀이: // 총 시간 복잡도는: O(M) + 2*O(N) => M = N - 1일 것을 생각하면 대략 3 * O(N), 즉 O(N)이다. function solution(participants, completion) { // 1. completion 객체 명단을 만든다. => O(M) const completed = new Map() for (const completer of completion) { // O(M) if (completed.has(completer)) { // O(1) completed.set(completer, complete..

    4/24 월 (클라우드 컴퓨팅의 이점과 분류) TIL

    클라우드 (Cloud) 컴퓨팅이란: IT 시스템을 직접 구매하는 대신 임대하여 사용할 수 있는 서비스: 인터넷을 통해 구독 기반의 데이터 스토리지, 보안, 네트워킹, 소프트웨어 애플리케이션 및 비즈니스 인텔리전스와 같은 서비스를 제공하는 것. 서비스의 유형에 따른 분류SaaS, Software as a Service: 서비스 공급자에 의해 실행되고 관리되는 완전한 제품을 서비스하는 것. 한 마디로 웹 브라우저를 통해 언제 어디서나 소프트웨어에 액세스할 수 있는 것. 서비스 제공자는백업, 유지보수, 업데이트를 관리한다. SaaS 솔루션의 종류에는 전사적 자원 관리(ERP), 고객 관계 관리(CRM), 프로젝트 관리 등이 포함된다. PaaS, Platform as a Service: 클라우드 기반의 애플리케..