156: Add two numbers

Given two non-empty linked lists, representing two integers, return their sum

Note: The numbers are stored in reverse order, 19 = 9 -> 1

 

Example 1

Input:  list1 = 1 -> 2 -> 3, list2 = 1 -> 4

Output: 2 -> 6 -> 3

Explanation: 321 + 41 = 362

Example 2

Input:  list1 = 9 -> 1, list2 = 1 -> 0 -> 5

Output: 0 -> 2 -> 5

Explanation: 19 + 501 = 520

Difficulty:Medium
Topic:Linked list
Problem #:156