일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- C#
- condition
- 앙상블
- 보안
- generic
- BOJ
- dotenv
- Clone
- AI
- property
- type
- bash
- Python
- docker
- webpack
- npm
- scss
- security
- VUE
- vue.js
- nginx
- leetcode
- loop
- var
- JavaScript
- vuetify
- TypeScript
- machine learning
- C++
- git
- Today
- Total
목록PS/LeetCode (49)
ice rabbit programming
https://leetcode.com/problems/pascals-triangle/ Pascal's Triangle - LeetCode 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 윗 열 두 개의 합이 아래 원소가 되는 파스칼 삼각형 문제이다. 정직하게 구현했다. class Solution { public: vector generate(int numRows) { vector pascal; if(numRows
https://leetcode.com/problems/maximum-depth-of-binary-tree/ Maximum Depth of Binary Tree - LeetCode 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 바로 전 문제와 반대로 가장 깊은 leaf node의 depth를 구하는 문제이다. 간단한 DFS 문제이고, 재귀를 이용해 풀었다. /** * Definition for a binary tree node. * struct TreeNode { * int va..
https://leetcode.com/problems/minimum-depth-of-binary-tree/ Minimum Depth of Binary Tree - LeetCode 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 이진 트리에서 최소 깊이를 가진 leaf node의 depth를 구하는 문제이다. 기본적인 BFS 문제라고 생각한다. /** * Definition for a binary tree node. * struct TreeNode { * int val; * Tre..
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode 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 주어진 배열에서 value 차가 가장 큰 경우를 구하는데, 뺄 때 큰 수는 index가 작은 수보다 뒤여야 한다. 처음에는 단순히 2중 선형 탐색으로 풀까 하다가, 조금 빠른 방법이 없을까 하여 value 및 index 기준으로 정렬한 후에 탐색..
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ Two Sum II - Input array is sorted - LeetCode 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 Two Sum 2탄이다. 이미 정렬된 배열에서, 합이 target과 맞는 인덱스를 반환한다. class Solution { public: vector twoSum(vector& numbers, int target) { vector resu..
https://leetcode.com/problems/linked-list-cycle/ [ Linked List Cycle - LeetCode 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 ](https://leetcode.com/problems/linked-list-cycle/) 리스트에 사이클이 있는지 여부를 판단하는 검사이다. 대기업 코테 준비 당시에는 BFS, DFS만 죽어라 하다가 리스트 관련 문제를 처음 접해서 처음에 풀이법이 잘 떠오르지 않았다. C#으로 풀었고, ..
https://leetcode.com/problems/remove-duplicates-from-sorted-list/ [ Remove Duplicates from Sorted List - LeetCode 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 ](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) 이 문제와 비슷한데, 여기서는 배열이 아닌 List이다. value가 같으면 연결을 끊고 그 다음을 연결했다..
https://leetcode.com/problems/climbing-stairs/ Climbing Stairs - LeetCode 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 1스텝 혹은 2스텝씩 이동하여 계단을 오르는 문제이다. 전형적인 DP 문제이다. 해당 칸까지 가는 수는 이전 칸에서 해당 칸에 오는 수만큼이기 때문이다. Kn = Kn-1 + Kn-2의 간단한 점화식을 찾아서 구현하였다. class Solution { public: int climbStairs(int ..