LeetCode

    [LeetCode] 153. Find Minimum in Rotated Sorted Array

    [LeetCode] 153. Find Minimum in Rotated Sorted Array

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ Find Minimum in Rotated Sorted Array - 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 문제 해설 오름차순으로 정렬된 길이가 n인 배열이 1번에서 n번 회전한다고 가정합니다. 예를 들어 배열 nums =..

    [LeetCode] 152. Maximum Product Array

    [LeetCode] 152. Maximum Product Array

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. https://leetcode.com/problems/maximum-product-subarray/ Maximum Product Subarray - 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 문제 해설 숫자 배열이 주어지고, 연속되고 빈 배열이 아닌 부분 배열 중 곱의 값이 가장 큰 것을 찾아 return 한다. 앞서 해설했던 53. Maximum..

    [LeetCode] 53. Maximum Subarray

    [LeetCode] 53. Maximum Subarray

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. https://leetcode.com/problems/maximum-subarray/ Maximum Subarray - 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 문제 해설 입력 값으로 nums 라는 배열이 들어오고, 배열에는 최소 하나의 정수가 존재한다. 배열 원소들 중 연속되는 subarray의 합이 최대가 되는 값을 찾아 return 해야 한..

    [LeetCode] 238. Product of Array Except Self

    [LeetCode] 238. Product of Array Except Self

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/product-of-array-except-self/ Product of Array Except Self - 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 배열에서 현재 요소를 뺀 나머지 요소들을 곱한 값을 그 자리에 넣어서 Return 해야한다. 1. 입력한 리스트와 같은 크기의 리스트를 ..

    [LeetCode] 217. Contains Duplicate

    [LeetCode] 217. Contains Duplicate

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/contains-duplicate/ Contains Duplicate - 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: def containsDuplicate(self, nums: List[int]) -> bool: # Sol 1 -- O(n) # dist..

    [LeetCode] 121. Best Time to Buy and Sell Stock

    [LeetCode] 121. Best Time to Buy and Sell Stock

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: 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 풀이: class Solution: def maxProfit(self, prices: List[int]) -> int: if ..

    [LeetCode] 1. Two Sum

    [LeetCode] 1. Two Sum

    *알고리즘 스터디에 참여하면서 Blind 75 LeetCode Questions 목록에 있는 문제를 풀이합니다. 문제: https://leetcode.com/problems/two-sum/ Two Sum - 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: def twoSum(self, nums: List[int], target: int) -> List[int]: nums_dic = {} # Stores the dictionary..