반응형 전체 글571 [리트코드 leetcode] 46. Permutations leetcode.com/problems/permutations/ Permutations - 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 permute(self, nums: List[int]) -> List[List[int]]: results=[] def dfs(result=[],next=[]): if len(result)==len(nums): results.append(result[:]) return for i in rang.. 2021. 4. 12. [리트코드 leetcode] 17. Letter Combinations of a Phone Number leetcode.com/problems/letter-combinations-of-a-phone-number/ Letter Combinations of a Phone Number - 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 letterCombinations(self, digits: str) -> List[str]: dict ={ '2':'abc', '3':'def', '4':'ghi', '5':'jkl', '6':'mno'.. 2021. 4. 12. [리트코드 leetcode] 200. Number of Islands 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 class Solution: def numIslands(self, grid: List[List[str]]) -> int: row = len(grid[0]) col = len(grid) def dfs(y,x): if (0 2021. 4. 12. [리트코드 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. 이전 1 ··· 79 80 81 82 83 84 85 ··· 96 다음 반응형