반응형 Problem Solving/리트코드44 [리트코드 leetcode] 347. Top K Frequent Elements leetcode.com/problems/top-k-frequent-elements/ Top K Frequent Elements - 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 topKFrequent(self, nums: List[int], k: int) -> List[int]: dict = collections.Counter(nums) output = [] value = dict.most_common(k) for i in r.. 2021. 4. 12. [리트코드 leetcode] 3. Longest Substring Without Repeating Characters leetcode.com/problems/longest-substring-without-repeating-characters/ Longest Substring Without Repeating Characters - 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 lengthOfLongestSubstring(self, s: str) -> int: p1,p2 = 0,0 length =0 dict=collections.defaultdi.. 2021. 4. 12. [리트코드 leetcode] 23. Merge k Sorted Lists (HARD) leetcode.com/problems/merge-k-sorted-lists/ Merge k Sorted Lists - 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: def mergeKLists(self.. 2021. 4. 12. [리트코드 leetcode] 739. Daily Temperatures leetcode.com/problems/daily-temperatures/ Daily Temperatures - 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 dailyTemperatures(self, T: List[int]) -> List[int]: stack=[] answer = [0 for _ in range(len(T))] for i,v in enumerate(T): while stack and T[stack[-1]] 2021. 4. 12. [리트코드 leetcode] 328. Odd Even Linked List leetcode.com/problems/odd-even-linked-list/ Odd Even Linked 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: def oddEvenList(self.. 2021. 4. 12. [리트코드 leetcode] 24. Swap Nodes in Pairs leetcode.com/problems/swap-nodes-in-pairs/ Swap Nodes in Pairs - 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: def swapPairs(self, he.. 2021. 4. 12. 이전 1 ··· 3 4 5 6 7 8 다음 반응형