| Question If a canoe can hold 2 kids and a max weight of 150 lbs, write a function that returns the minimum number of canoes needed, given a list of kids and their weights. 번역 : 하나의 카누에는 2명의 아이를 탑승시킬 수 있고, 카누의 최대하중은 150 lbs이다. 아이들의 무게를 나타내는 list가 주어질 때 필요한 카누의 수가 최소가 되는 함수를 작성하라. | Solution 문제를 풀 때 고려한 사항 아이들이 0명일 때 알고리즘이 정상 동작해야 한다. 아이들의 무게는 lsb단위로 주어진다고 가정한다. 아이들이 홀 수 일 때와 짝수일 때 모두 함수가 정상 동작해..
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bIPWH8/btrKA3dk9AZ/qvYIhB32G6XjT2McdKxwYk/img.jpg)
| Question Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself. 번역 : 문자열 s와 t가 주어졌을 때 두 문자열이 isormorphic인지 판단..
| Question Pots of gold game: Two players A & B. There are pots of gold arranged in a line, each containing some gold coins (the players can see how many coins are there in each gold pot - perfect information). They get alternating turns in which the player can pick a pot from one of the ends of the line. The winner is the player which has a higher number of coins at the end. The objective is to..
| Question You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists. For example, List 1: [4, 10, 15, 24, 26] List 2: [0, 9, 12, 20] List 3: [5, 18, 22, 30] The smallest range here would be [20, 24] as it contains 24 from list 1, 20 from list 2, and 22 from list 3. 번역 : 정수로 이루어진 배열 k개가 주어졌을 때, 각 배열의 원소를 적어도 하나 포함하는 가장 작은 범위를 찾아라. 예를 ..
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/pmGZZ/btrJ8HWDNAk/RfC3YLrnyotzMk9cr3nGEK/img.jpg)
Question Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. 이진 탐색 트리와 정수 k가 주어졌을 때, 모든 노드 중 k번째로 작은 값을 리턴하는 함수를 작성하라. 제약사항 The number of nodes in the tree is n. 1 right); } int kthSmallest(TreeNode* root, int k) { vector node_val_vec; AddAllElement(node_val_vec, root); return node_val_vec[k-1]; } }; Time..
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/d05HkS/btrKasRWPU6/BqylQVJmpaRhKIKCMaPNWk/img.jpg)
Question You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: 완전 이진트리가 주어진다면 같은 레벨의 노드를 모두 오른쪽으로 연결하는 함수를 작성하라. struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be s..
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/clEvbd/btrKcxlctwb/oe1OICLJKe8B1Xz6yaeUpk/img.jpg)
Question Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. 이진 탐색 트리의 preorder 순서와 inorder순서로 탐색한 결과인 두 배열이 주어질 때, 원래의 이진트리를 출력하라. 제약사항 1
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bmyW7I/btrKcwGAkLQ/imymFcEEPqz1PY6jQkw77k/img.jpg)
Question Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between). 이진트리의 root 가 주어졌을 때 지그재그로 노드의 값을 출력하는 함수를 작성하라. 제약사항 The number of nodes in the tree is in the range [0, 2000]. -100 left){ next_level.push(top->left); } if(top->right){ next_level.push(top->right); } }els..
- Total
- Today
- Yesterday
- 코딩인터뷰
- 러스트 기초
- 맛집
- C++
- Tree
- 인터뷰
- 러스트 입문
- rust
- 속초
- 트리
- 솔직후기
- 내돈내산
- 러스트
- 반드시 알아야 할 자료구조
- interview question
- Medium
- coding interview
- LeetCode
- ProblemSolving
- algorithm
- 러스트 배우기
- Interview
- 리트코드
- 기술면접
- Problem Solving
- 알고리즘
- 자료구조
- PS
- DP
- 속초 맛집
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |