'leetcode' 태그의 글 목록
주한서하아빠 개발 블로그
LeetCode/Array
121. Best Time to Buy and Sell Stock ✨
2025.12.04
🎉 문제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: prices = [7,1,5,3,6,4] Output: 5 Expl..
LeetCode/NeetCode
LeetCode 3: Longest Substring Without Repeating Characters
2025.06.14
문제 Given a string s, find the length of the longest substring without duplicate characters. Example 1:Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:Input: s = "bbbbb"Output: 1Explanation: The answer is "b", with the length of 1.Example 3:Input: s = "pwwkew"Output: 3Explanation: The answer is "wke", with the length of 3.Notice that the answer must ..
LeetCode
283. Move Zeroes
2021.04.07
Given an integer arraynums, move all0's to the end of it while maintaining the relative order of the non-zero elements. Notethat you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] Constraints: 1