天天看點

[LeetCode]--2. Add Two Numbers

you are given two linked lists representing two non-negative numbers. the digits are stored in reverse order and each of their nodes contain a single digit. add the two numbers and return it as a linked list.

input: (2 -> 4 -> 3) + (5 -> 6 -> 4)

output: 7 -> 0 -> 8

這是我寫的,雖然通過了但是我覺得還可以提高,點了一下看到了一個别人寫程式,亮瞎我眼了。