| Topic | Difficulty | Companies |
|---|---|---|
| Linked List | MEDIUM | Amazon Microsoft Facebook |
You are given two numbers represented in the form of linked lists A and B. Write a program to add these two numbers and return the sum in the form of the linked list.
Problem Note:
Example 1
Input: (2->5->1) + (4->6->2)
Output: (6->1->4)
Explanation: 152 + 264 = 416
Example 2
Input: (3->8->6) + (2->3)
Output: 5->1->7
Explantion: 683 + 32 = 715
Example 3
Input: 8 + 4 (two lists with only one digit)
Output: 2->1
Explanation: 8 + 4 = 12