728x90 반응형 leetcode23 Leetcode 200. Number of Islands (Union Find) https://leetcode.com/problems/number-of-islands/ Number of Islands - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 이 문제는 Union Find와 관련된 문제로 관련된 개념은 아래에서 참고하실 수 있습니다 https://psygo22.tistory.com/59 Union Find Union Find 란? : Data structure that keeps track of elements which are sp.. 2022. 9. 27. Leetcode 238. Product of Array Except Self https://leetcode.com/problems/product-of-array-except-self/ Product of Array Except Self - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 처음 접근) import math class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: answer = [] total = math.prod(nums) if 0 not in n.. 2022. 9. 26. Leetcode 207. Course Schedule 풀이 (Topological Sorting, BFS, DFS) https://leetcode.com/problems/course-schedule/ Course Schedule - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 이 문제를 풀기 위해서는 Topological Sorting에 대한 이해가 필요하기 때문에 정리해보려합니다 √ Topological Sorting (위상정렬) 이란? Directed Acyclic Graph (방향성비순환그래프, DAG)의 꼭지점들이 선형적으로 정렬된 것을 의미합니다 DAG이름이 어렵지.. 2022. 9. 23. Leetcode 150. Reverse Polish Notation (Stack) https://leetcode.com/problems/evaluate-reverse-polish-notation/ Evaluate Reverse Polish Notation - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Polish Notation이 궁금하신 분들은 아래 위키 백과를 참조하시길 바랍니다 더보기 https://ko.wikipedia.org/wiki/%EC%97%AD%ED%8F%B4%EB%9E%80%EB%93%9C_%ED%91%9C%EA%B8%B.. 2022. 9. 22. Leetcode 15. 3Sum (two-pointer) https://leetcode.com/problems/3sum/ 3Sum - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 제출코드) class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: answer = [] nums.sort() if len(nums) 0: j -= 1 elif total < -val: i += 1 return answer 이전에 Leetcode 1번 twoSum 문제를.. 2022. 9. 21. Leetcode 10. Regular Expression Matching (정규표현식, Dynamic Programming) 문제. input string s과 '.'와 '*'가 포함된 정규표현식 pattern p가 주어졌을 때, matching이 전체 input string을 포함하는지 여부를 반환하라 https://leetcode.com/problems/regular-expression-matching/ Regular Expression Matching - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이방법) import re class Solution: def isMatch(.. 2022. 9. 19. 이전 1 2 3 4 다음 728x90 반응형