Leetcode(2) - Add two numbers

Given two non-empty linked lists to represent two non-negative integers. The bits are stored in reverse order, with each node storing only a single digit. Adds two numbers and returns a new linked list.

You can assume that neither number starts with a zero except for the number 0.

Example:

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326115815&siteId=291194637