| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- matrix
- Medium
- backtracking
- 재귀
- Python
- 이진트리
- 리트코드
- linked list
- Binary
- list
- tree
- 문자열
- Depth-first Search
- easy
- DP
- binary search
- hash table
- dfs
- Array
- two pointers
- recursive
- 미디움
- HashTable
- leetcode
- string
- binary tree
- sorting
- 중간
- 쉬움
- math
- Today
- Total
목록분류 전체보기 (147)
부부의 코딩 성장 일기
1. 문제 링크 https://leetcode.com/problems/binary-tree-paths/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 binary tree의 root가 주어졌을 때, root부터 leaf까지 가는 모든 paths를 list에 append하여 반환 여기서 leaf란 children이 없는 n..
얕은 복사란? 원본 객체의 요소들을 새로운 객체로 복사하지만, 내부에 있는 객체들은 참조로 복사 내부 객체는 그래서 동일한 객체를 가리키게 됨 아래 예제를 보면 단순히 list를 copy한 후, 기존 리스트(original_list)를 변경하면, 얕은 복사를 한 shallow_copy도 값이 변하게 됨. "내부 객체가 동일한 객체 - 같은 주소"를 가리키고 있기 때문! original_list = [1, [2, 3], 4] shallow_copy = original_list.copy() # 얕은 복사 후 내부 리스트의 참조는 동일함 original_list[1][0] = 99 print(original_list) # 출력: [1, [99, 3], 4] print(shallow_copy) # 출력: [1,..
1. 문제 링크 Interleaving String - LeetCode LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 두 개의 문자열이 주어질 때, 두 문자열이 교차로 섞여서 주어진 문자열 목표 문자열을 형성할 수 있는지 판단하여 True, False를 반환하는 문제 예시) s1 = "aabcc", s2 = "dbbca", s3 = "aadb..
1. 문제 링크 https://leetcode.com/problems/valid-anagram/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 문자열 s와 t가 주어졌을 때, 만약 t가 s의 Anagram이라면 True를 반환, 아니라면 False를 반환 여기서 Anagram이란, 일반적으로 모든 원래 문자를 정확히 한..
1. 문제 링크 https://leetcode.com/problems/palindrome-linked-list/ LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 주어진 연결 리스트가 팰린드롬(좌우 뒤집어 같은 것)인지 확인하여 True 또는 False를 반환 3. 처음 풀이 head의 값을 리스트에 하나씩 추가한 후 그 리스트와 역순이 같으면 ..
1. 문제 링크 https://leetcode.com/problems/implement-queue-using-stacks/ Implement Queue using Stacks - LeetCode Can you solve this real interview question? Implement Queue using Stacks - Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Implement t leetcode.com 2. 문제 설명 큐(Queue)는 ..
1. 문제 링크 https://leetcode.com/problems/implement-stack-using-queues/ LeetCode - The World's Leading Online Programming Learning Platform 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 2. 문제 설명 queue를 활용하여 stack을 구현하라. 여기서 stack은 last-in-first-out (LIFO)를 의미 일반적인 stack은 push, top, pop, empt..
1. 문제 링크 https://leetcode.com/problems/power-of-two/description/ 2. 문제 설명 정수 n이 주어졌을 때, 만약 해당 수가 2의 거듭제곱이면 True를 아니면 False를 반환 예시1) n=1일 때, 1은 2의 0 거듭제곱이므로 True 반환 예시2) n=16일 때, 16은 2의 4 거듭제곱이므로 True 반환 예시3) n=3일 때, 3은 2의 거듭제곱이 아니므로 False를 반환 3. 처음 풀이 Follow up에서 loops나 recursion을 쓰지 않고, 풀 수 있는지를 물어봐서 다른 방법을 생각해보다가, 10진법을 2진법으로 바꾸었을 때, 2의 거듭제곱이라면 10000, 100, 10 등의 형태일 것이기 때문에, 1을 제외한 값을 int로 변환했..