Leetcode 279

[Monotonic Stack][Medium] 901. Online Stock Span

https://leetcode.com/problems/online-stock-span/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 Q. next()를 통해 그 날의 stock price가 주어진다. 연속해서 이 값보다 같거나 적은 날의 수를 반환하라. Solution. 주어진 모든 input를 list나 vector로 저장한다. 뒤에서..

Leetcode/LeetCode75 2024.02.06

[Monotonic Stack][Medium] 739. Daily Tempreatures

https://leetcode.com/problems/daily-temperatures/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 Q. 주어진 배열은 각 날짜의 온도를 의미한다. 각 날짜에서 해당 일보다 더 따뜻한 날을 만나기까지 기다려야 하는 날 수를 출력하라. Solution. 일단 2중 배열을 돌면 해결은 간단해 진다. 하지만 ..

Leetcode/LeetCode75 2024.02.04

[Interval][Medium] 452. Minimum Number of Arrows to Burst Balloons

https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/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 Q. 주어진 input을 풍선의 직선에서의 좌표라고 가정한다. 이때 풍선을 모두 떠뜨릴 수 있는 화살의 수를 구하라. 겹쳐진 풍선은 모두 한번에 떠뜨릴 수 있다...

Leetcode/LeetCode75 2024.02.04

[Interval][Medium] 435. Non-overlapping Intervals.

https://leetcode.com/problems/non-overlapping-intervals/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 Q. start와 end로 이루어진 다수의 interval들이 input으로 주어진다. 겹치는 구간이 존재할때, 이 겹치는 구간을 제거해서 interval이 겹쳐지지 않도록 하라. 이때 이 제..

Leetcode/LeetCode75 2024.02.01

[Bit Manipulation][Medium] 1318. Minimum Flips to Make a OR b Equal to c

https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c/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 Q. a 와 b를 OR 하여서 c 가 될수 있는 최소 flip 수를 구하라. Solution 우선 각 자리 bit는 어떻게 구하나. value & 1 의 결과는 제일 ..

Leetcode/LeetCode75 2024.01.31

[Bit Manipulation][Easy] 136. Single Number

https://leetcode.com/problems/single-number/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 Q. 주어진 배열 nums에서 단하나의 원소를 제외하고 모든 원소는 2회씩 출현한다. 이때 이 한번 출현하는 값을 찾아라. TC를 O(N)으로 추가 메모리를 사용치 말아라. Solution. XOR의 특성을 알고 ..

Leetcode/LeetCode75 2024.01.30

[Bit Manipulation][Easy] 338. Counting Bits

https://leetcode.com/problems/counting-bits/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 Q. n이 주어질때 0 ~ n 까지의 수를 2진수로 변환하고, 그 2진수에서 1의 개수를 vector로 출력하라. Solution. bit check의 기본에 해당하는 문제. 우선 직관에 근거해 로직은 전개해 풀어..

Leetcode/LeetCode75 2024.01.29

[DP-MultiDimensional][Medium] 72. Edit Distance

https://leetcode.com/problems/edit-distance/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 Question. 주개의 string word1과 word2가 주어질때, word1과 word2를 같게 만들기 위해 최소한의 필요한 연산 수를 구하라. 단, 아래와 같은 연산이 한번에 가능하다. 문자 당, 삭제, ..

Leetcode/LeetCode75 2024.01.28

[DP-Multidimensional][Medium] 714. Best Time to Buy and Sell Stock with Transaction Fee.

https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/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 Q. 주어진 배열 prices에서 각 값은 그날 stock의 가격을 의미한다. stock을 사고 팔때, fee의 비용이 발생한다면, 얻을 수 있..

Leetcode/LeetCode75 2024.01.26

[DP-MultiDimensional][Medium][Good] 1143. Longest Common Subsequence

https://leetcode.com/problems/longest-common-subsequence/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 Q. text1, text2가 주어질때, 두 text의 가장 긴 공통 subsequence string의 길이를 구하라. Solution. 우선 매우 좋은 문제다. 대놓고 이런 식으로 해결하..

Leetcode/Challenges 2024.01.24