리트코드 파이썬 13

[leetcode] 128. Longest Consecutive Sequence 시간복잡도 O(n) 풀이, 해설 (python)

문제 링크 https://leetcode.com/problems/longest-consecutive-sequence/ Longest Consecutive Sequence - LeetCode Can you solve this real interview question? 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. Example 1: Input: leetcode.com 1차 풀이 O(n)을 목표로 풀다가, O(nlogn..

[leetcode] 36. Valid Sudoku 풀이, 해설 (python)

[leetcode] 49. Group Anagrams 풀이, 해설 (python) 문제 링크 https://leetcode.com/problems/valid-sudoku/ Valid Sudoku - LeetCode Can you solve this real interview question? 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: 1. Each row must contain the digits 1-9 without repetition. 2. Each c leetcode.com 스도쿠가 유효한지 확인하는 ..

[leetcode] 49. Group Anagrams 풀이, 해설 (python)

문제 링크 https://leetcode.com/problems/group-anagrams/ Group Anagrams - LeetCode Can you solve this real interview question? 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 leetcode.com 'eat','aet','tae' 등으로 동일한 캐릭터로 순서만 바꿔서 나왔을때, 해당 문자..

반응형