Limit

· One step
LeetCode-15 Match Three sum : Notice that the solution set must not contain duplicate triplets. note : myAnswerMyAnswer(Time Limit Exceeded) O(n^2) :::python class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: a = [] nums.sort() for i, n in enumerate(nums): d = {} for j in range(i+1,len(nums)): complete = - (n + nums[j]) if complete in d: if sorted([n, nums[j], complete]) not..
다했다
'Limit' 태그의 글 목록