본문 바로가기
반응형

🖥️ 문제 풀이111

[LeetCode 해석 및 풀이] 155. Min Stack LeetCode 문제 해석 및 풀이 방법 문제 155. Min Stack(최소 스택) 바로가기 문제 설명 영문 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class MinStack() initializes the stack object. void push(int val) pushes the element val onto the stack. void pop() removes the element on the top of the stack. int top() gets the top element of the stack. int getMi.. 2024. 4. 16.
[LeetCode 해석 및 풀이] 20. Valid Parentheses LeetCode 문제 해석 및 풀이 방법 문제 20. Valid Parentheses(유효한 괄호) 바로가기 문제 설명 영문 Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same typ.. 2024. 4. 16.
[LeetCode 해석 및 풀이] 15. 3Sum LeetCode 문제 해석 및 풀이 방법 문제 15. 3Sum(3개의 합) 바로가기 문제 설명 영문 Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. 한글 정수 배열 nums가 주어지면, i,j,k가 서로 다르고, nums[i] + nums[j] + nums[k] == 0가 되는 모든 트리플 [nums[i], nums[j], nums[k]]을 반환하세요. 답에는.. 2024. 4. 16.
[LeetCode 해석 및 풀이] 167. Two Sum II - Input Array Is Sorted LeetCode 문제 해석 및 풀이 방법 문제 167. Two Sum II - Input Array Is Sorted(두개의 합2 - 입력 배열이 정렬) 바로가기 문제 설명 영문 Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 2024. 4. 16.
[LeetCode 해석 및 풀이] 125. Valid Palindrome LeetCode 문제 해석 및 풀이 방법 문제 125. Valid Palindrome(유효한 회문) 바로가기 문제 설명 영문 A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers Given a string s, return true if it is a palindrome, or false otherwise. 한글 모든 비-영숫자(alphanumeric) .. 2024. 4. 16.
[LeetCode 해석 및 풀이] 128. Longest Consecutive Sequence LeetCode 문제 해석 및 풀이 방법 문제 128. Longest Consecutive Sequence(가장 긴 연속된 수열) 바로가기 문제 설명 영문 Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. 한글 정렬되있지 않은 정수 배열 nums가 주어지면 가장 긴 연속된 수열의 길이를 구하시오 반드시 O(n)으로 알고리즘을 작성해여야 합니다. 제한조건 0 int: nums = set(nums) res = 0 while nums: n = nums.pop() down = n -.. 2024. 4. 15.
반응형