[LeetCode] 21. Merge Two Sorted Lists
Python # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next...
Python # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next...
Python class Solution: def isValid(self, s: str) -> bool: stack = [] table = { ')' : '(', '}' : '{', ...
Python class Solution: def arrayPairSum(self, nums: List[int]) -> int: return sum(sorted(nums)[::2])
Python ~~~python class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: result = [] p = 1
Python ~~~python class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: result = [] nums.sort()