leetcode
-
[Algorithm] LeetCode 53. Maximum SubarrayAlgorithm 2023. 10. 12. 00:32
53. Maximum Subarray Medium Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1] has the largest sum 6. Example 2: Input: nums = [1] Output: 1 Explanation: The subarray [1] has the largest sum 1. Example 3: Input: nums = [5,4,-1,7,8] Output: 23 Explanation: The suba..
-
[Algorithm] LeetCode 238.product-of-array-except-selfAlgorithm 2023. 10. 10. 23:23
238. Product of Array Except Self Medium Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division operation. Example 1: Input: nums = [1,2,3,4] Out..
-
[Algorithm] LeetCode 217.contains-duplicateAlgorithm 2023. 10. 10. 23:20
217. Contains Duplicate Easy Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints: 1
-
[Algorithm] LeetCode 121. Best Time to Buy and Sell StockAlgorithm 2023. 9. 30. 20:07
121. Best Time to Buy and Sell Stock Easy 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 cannot achieve any profit, return 0. Example 1: Input:..
-
[LeetCode] 추천 75 문제 및 알고리즘 공부 방법Algorithm 2023. 9. 30. 18:11
주소 https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU New Year Gift - Curated List of Top 75 LeetCode Questions to Save Your Time New Year Gift to every fellow time-constrained engineer out there looking for a job, here's a list of the best LeetCode questions that teach you core concepts and techniques for each category/type of pro..
-
[Algorithm] LeetCode 7. Reverse IntegerAlgorithm 2023. 9. 26. 00:35
7. Reverse Integer Medium Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). Example 1: Input: x = 123 Output: 321 Example 2: Input: x = -123 Output: -321 Example 3: Input: x = 120 O..
-
[GitHub] 알고리즘 자동 업로드 크롬 확장 프로그램 LeetHubGit 2023. 1. 16. 21:28
GitHub 잔디 심기, 기록 남기기, 추후 리팩토링 하기 위해서, 동기부여를 얻기 위해서 등 알고리즘 문제를 풀고 GitHub에 업로드 하려는 목적은 다양할 것이다. 이번 포스팅에서는 그 중에서도 LeetCode 사이트에서 알고리즘 문제를 푼 경우, 자동으로 GitHub에 업로드 해주는 크롬 확장 프로그램을 소개하고자 한다. 바로 'LeetHub' 라는 크롬 확장 프로그램이다. 이름 그대로 LeetCode 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 ..