본문 바로가기
반응형

🖥️ 문제 풀이111

[LeetCode 해석 및 풀이] 121. Best Time to Buy and Sell Stock LeetCode 문제 해석 및 풀이 방법 문제 121. Best Time to Buy and Sell Stock(주식을 사고팔기 가장 좋은 시간)바로가기 문제 설명영문You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you can.. 2024. 5. 1.
[LeetCode 해석 및 풀이] 981. Time Based Key-Value Store LeetCode 문제 해석 및 풀이 방법 문제 981. Time Based Key-Value Store(시간 기반 키-값 저장) 바로가기 문제 설명 영문 Design a time-based keyvalue data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp. Implement the TimeMap class: TimeMap() Initializes the object of the data structure. void set(String key, String value, int timestamp) Stores .. 2024. 4. 23.
[LeetCode 해석 및 풀이] 33. Search in Rotated Sorted Array LeetCode 문제 해석 및 풀이 방법 문제 33. Search in Rotated Sorted Array(한글 번역) 바로가기 문제 설명 영문 There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 2024. 4. 23.
[LeetCode 해석 및 풀이] 153. Find Minimum in Rotated Sorted Array LeetCode 문제 해석 및 풀이 방법 문제 153. Find Minimum in Rotated Sorted Array(돌아간 정렬된 배열에서 최소값 찾기) 바로가기 문제 설명 영문 Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [4,5,6,7,0,1,2] if it was rotated 4 times. [0,1,2,4,5,6,7] if it was rotated 7 times. Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1].. 2024. 4. 22.
[LeetCode 해석 및 풀이] 875. Koko Eating Bananas LeetCode 문제 해석 및 풀이 방법 문제 875. Koko Eating Bananas(바나나 먹는 코코) 바로가기 문제 설명 영문 Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she ea.. 2024. 4. 21.
[LeetCode 해석 및 풀이] 74. Search a 2D Matrix LeetCode 문제 해석 및 풀이 방법 문제 74. Search a 2D Matrix(2D 행렬에서 찾기) 바로가기 문제 설명 영문 You are given an m x n integer matrix matrix with the following two properties: Each row is sorted in non-decreasing order. The first integer of each row is greater than the last integer of the previous row. Given an integer target, return true if target is in matrix or false otherwise. You must write a solution in O(log(.. 2024. 4. 21.
반응형