leetcode

    [Leetcode] 01. Add Two Numbers (Medium)

    [Leetcode] 01. Add Two Numbers (Medium)

    # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next #최종 제출 class Solution: def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]: result = ListNode() curr_node = result while True: next_val, curr_node.val = divmod(curr_node.val+l1.val+l2.val, 10) curr_node.next = ListNode(val=ne..