반응형 Problem Solving232 [리트코드 leetcode] 147. Insertion Sort List leetcode.com/problems/insertion-sort-list/ Insertion Sort List - 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 풀긴 하였지만 소요 시간이 매우 길다.. # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution:.. 2021. 4. 14. [리드코드 leetcode] 56. Merge Intervals leetcode.com/problems/merge-intervals/ Merge Intervals - 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 merge(self, intervals: List[List[int]]) -> List[List[int]]: intervals.sort(key = lambda x: x[0]) result = [] temp = intervals[0] for i .. 2021. 4. 14. [리트코드 leetcode] 105. Construct Binary Tree from Preorder and Inorder Traversal leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ Construct Binary Tree from Preorder and Inorder Traversal - 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 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None,.. 2021. 4. 13. [리트코드 leetcode] 783. Minimum Distance Between BST Nodes leetcode.com/problems/minimum-distance-between-bst-nodes/submissions/ Minimum Distance Between BST Nodes - 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 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # s.. 2021. 4. 12. [리트코드 leetcode] 938. Range Sum of BST leetcode.com/problems/range-sum-of-bst/ Range Sum of BST - 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 풀긴 하였지만 brute force이므로 개선의 여지가 존재한다. 가지치기 방법을 생각해봐야겠다. # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = .. 2021. 4. 12. [리트코드 leetcode] 1038. Binary Search Tree to Greater Sum Tree leetcode.com/problems/binary-search-tree-to-greater-sum-tree/ Binary Search Tree to Greater Sum Tree - 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 # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self... 2021. 4. 12. 이전 1 ··· 30 31 32 33 34 35 36 ··· 39 다음 반응형