일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- nginx
- vuetify
- VUE
- condition
- scss
- C++
- JavaScript
- 앙상블
- AI
- dotenv
- C#
- loop
- property
- BOJ
- Clone
- docker
- security
- generic
- webpack
- npm
- vue.js
- leetcode
- var
- 보안
- git
- type
- bash
- machine learning
- Python
- TypeScript
- Today
- Total
목록PS (53)
ice rabbit programming
https://leetcode.com/problems/add-binary/ Add Binary - 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 이 문제도 제목 그대로 이진수로 주어지는 string을 더해서 string으로 반환하는 문제이다. 논리회로 단계에서 Adder를 만들듯이 구현하였다. public class Solution { public string AddBinary(string a, string b) { int shortLength = (a.Leng..
https://leetcode.com/problems/same-tree/ Same 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 제목 그대로 주어진 Tree가 동일한 Tree인지 판단하는 문제이다. DFS를 통해 순회하면서 노드의 값들을 비교하는 식으로 구현하였다. 간만에 메모리와 시간 모두에서 100%를 기록하였다. /** * Definition for a binary tree node. * struct TreeNode { * int val; * ..
https://leetcode.com/problems/majority-element/ Majority Element - 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 가장 많이 등장하는 원소를 찾아내는 문제이다. 별 생각 없이 map을 이용해 풀었다. class Solution { public: int majorityElement(vector& nums) { int size = nums.size(); map counts; for(int i=0;isecond)++..
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://www.acmicpc.net/problem/17263 17263번: Sort 마스터 배지훈 지훈이는 Sort 마스터다. 그래서 어떠한 N개의 원소를 가진 배열이 들어오더라도 암산으로 오름차순 정렬을 할 수 있다고 한다. 의심 많은 보성이는 지훈이를 테스트해 보기로 마음먹었다. 하지만 모든 원소를 일일이 다 확인하는 것은 너무 귀찮은 일이라 생각한 보성이는 정렬된 배열의 마지막 원소만 맞는지 확인해 보기로 했다. 보성이를 위하여 마지막 원소를 알려주는 프로그램을 만들어주자. www.acmicpc.net 2019년 학교에서 개최한 문제풀이 대회에 3인 팀으로 출전하였다. 2등과 근소한 차이로 3등에 머물렀지만, 생각지도 않은 수상이어서 꽤 기뻤던 기억이 난다. 이후 경인지역 본선(Shake!)..