LeetCode_2-- adding two numbers (Add Two Numbers)

topic

We are given two non-empty list is used to represent two non-negative integer. Where their respective bits are stored in reverse order of the way, and they each node can store only one digit.
If we add up these two numbers, it will return a new list and to represent them.
You can assume that in addition to the numbers 0, these two numbers will not begin with 0.

Example:

Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
 Output: 7 -> 0 -> 8
 Cause: 342 + 465 = 807

 

A Solution

Thinking

Guess you like

Origin www.cnblogs.com/echola/p/11004346.html