본문 바로가기
반응형

분류 전체보기167

[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.
[LeetCode 해석 및 풀이] 36. Valid Sudoku LeetCode 문제 해석 및 풀이 방법 문제 36. Valid Sudoku(유효한 스도쿠) 바로가기 문제 설명 영문 Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must contain the digits 1-9 without repetition. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition. N.. 2024. 4. 14.
[LeetCode 해석 및 풀이] 238. Product of Array Except Self LeetCode 문제 해석 및 풀이 방법 문제 238. Product of Array Except Self(자기를 제외한 배열의 ) 바로가기 문제 설명 영문 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 op.. 2024. 4. 14.
[LeetCode 해석 및 풀이] 347. Top K Frequent Elements LeetCode 문제 해석 및 풀이 방법 문제 347. Top K Frequent Elements (상위 k번째로 자주 나오는 원소들) 바로가기 문제 설명 영문 Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. Follow up: Your algorithm's time complexity must be better than O(n log n), where n is the array's size. 한글 정수 배열 nums와 정수 k가 주어졌을 때, 상위 k번째로 자주 나오는 원소들의 목록을 구하세요. 순서는 아무렇게나 제출해도 상관없습니다.. 2024. 4. 14.
[LeetCode 해석 및 풀이] 49. Group Anagrams LeetCode 문제 해석 및 풀이 방법 문제 49. Group Anagrams(애너그램 그룹) 바로가기 문제 설명 영문 Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. 한글 문자열로 이루어진 배열 strs가 주어지면, 같은 아나그램을 묶으세요. 답의 순서는 상관 없습니다. 아나그램이란 일반적으로 모든 원래 .. 2024. 4. 11.
반응형