[leetcode-21] Merge Two Sorted Lists
ยท
๐ข One step
LeetCode-21 Merge Two Sorted Lists : Merge Two lists note : recursive :::python # Definition for singly-linked list. # class ListNode: # def init(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]: if (not list1) or (list2 and list1.val > list2.val): list1, list2 = list2,..