445. Add Two Numbers II


https://leetcode.com/problems/add-two-numbers-ii/



Runtime: 66 ms, faster than 87.38% of Python3 online submissions for Add Two Numbers II.
Memory Usage: 14.5 MB, less than 12.66% of Python3 online submissions for Add Two Numbers II.



```python
class Solution:
    def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        #8:28
        L1 = ""
        node = l1
        while node:
            L1 += str(node.val)
            node = node.next
            
        L2 = ""
        node = l2
        while node:
            L2 += str(node.val)
            node = node.next
            
        result = [int(i) for i in list(str(int(L1) + int(L2)))]
        head = ListNode(val=None, next=None)
        node = head
        for index, num in enumerate(result):
            node.val = num
            if (index != len(result)-1):
                node.next = ListNode(val=None, next=None)
                node = node.next
        return head
        #8:31
        #debug until 8:48
```
