| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
- binary search
- string
- backtracking
- 재귀
- linked list
- binary tree
- 미디움
- 문자열
- Array
- list
- 이진트리
- HashTable
- 쉬움
- 중간
- matrix
- 리트코드
- two pointers
- hash table
- recursive
- Binary
- easy
- Depth-first Search
- dfs
- leetcode
- Python
- Medium
- DP
- math
- tree
- sorting
- Today
- Total
목록분류 전체보기 (147)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/same-tree/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com 2. 문제 설명 이진 트리 p, q가 주어졌을 때, 두 트리가 같은 tree인지 판단 같다의 정의: 구조..
1. 문제 링크 Binary Tree Inorder Traversal - LeetCode Binary Tree Inorder Traversal - LeetCode Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1,nu leetcode.com 2. 문제 설명 이진 트리가 주어졌을 때 중위 순회(inorder tra..
1. 문제 링크 https://leetcode.com/problems/merge-sorted-array/ 2. 문제 설명 오름차순 정수로 구성된 두 array nums1, nums2와, 각 array의 개수를 m,n이라고 할 때, nums1, nums2를 오름차순 순서로 merge한 list를 반환 전제조건 "in-place" return하는 list는 nums1에 store해야 하며, 결과적으로 nums의 길이는 m+n이 됨 예시1) nums1 = [1,2,3,0,0,0] m=3, nums2 = [2,5,6] n= 3 → [1,2,2,3,5,6] 반환 예시2) nums1 = [1] m=1, nums2 = [] n= 0 → [1] 반환 3. 처음 풀이 nums1의 m+1~m+n 자리에 nums2 elem..
1. 문제 링크 Remove Duplicates from Sorted List - LeetCode Remove Duplicates from Sorted List - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted List - Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. Example 1: [https://assets.le leetcode.com 2. 문제 설명 오름차순 정렬된 연결 리스트(linke..
1. 문제 링크 https://leetcode.com/problems/climbing-stairs/ 2. 문제 설명 계단을 n steps에 거쳐 올라가며, 한번에 1 or 2 steps 씩밖에 오르지 못할 때, n개 계단을 오르는 방법의 수를 반환 예시1) n=2 이면 1step + 1step / 2steps 이렇게 두가지 방법이 가능하므로 2를 반환 예시2) n=3 이면 1step + 1step + 1step / 1step + 2steps / 2steps + 1steps 세 방법이 가능하므로 3을 반환 → 규칙을 찾아야하는 문제 3. 처음 풀이 2~7 steps 까지를 나열해보며 규칙을 찾았다. (물론 더 쉬운 규칙이 있었음) 3 step = 1 step으로 3번 움직이거나, 2step과 1step으로..
1. 문제 링크 Sqrt(x) - LeetCode Sqrt(x) - LeetCode Can you solve this real interview question? Sqrt(x) - Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. You must not use any built-in exponent function or o leetcode.com 2. 문제 설명 음이 아닌 정수가 x가 주어졌을 때 루트x 보다 작거나 같은 정수 중 최대인 것을 구하기 예시) x=4이면 2≤√4<3이므로 2를..
1. 문제 링크 https://leetcode.com/problems/add-binary/ 2. 문제 설명 이진법으로 구성된 두개의 문자열 a,b가 주어졌을 때, 두 개의 합을 이진법으로 반환 예시) a= "11", b= "1"이면 십진법으로 3+1= 4이고, 이를 다시 이진법으로 반환한 "100"을 반환 3. 처음 풀이 만약 두 문자열이 0이면 0을 반환, 두 문자열을 더한 값을 십진법으로 반환하고 → 다시 이진법으로 변환하는 식으로 풀이 "11"과 "1"을 더한 "12"를 십진법으로 변환하면, 2*1 + 1*2^1 = 4 4를 계속 2로 나누면서 이진법으로 변환 result = '' (sum_num = 4) result = '0' (sum_num = 2) result = '00' (sum_num = ..
1. 문제 링크 Plus One - LeetCode Plus One - LeetCode Can you solve this real interview question? Plus One - You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to- leetcode.com 2. 문제 설명 리스트 [1, 2, 3]가 주어지면 123에 1을 더한 124를 리스트로 바꾸어 [1, 2, 4]를 반환 3. 처음 풀이 주어..