###### 一些奇奇怪怪的解法

Q：

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.

A:

1、把链表转化成long相加之后再转化成链表

2、在链表的基础上做相加

1、把链表中倒叙的数字正过来

2、直接改变数字的进位效果，向后进位。

public class AddTwoNumbers {
public static void main(String[] args){
System.out.println(""+(int)i);
}

}
int maxLength = 0;
int minLength = 0;
int carry = 0;
}
else {
}
for(int i =0;i<minLength;i++){
carry = 0;
if(result>=10){//进位
carry = (int)result/10;
if(i==minLength-1){//超出了链表长度
if(i<maxLength-1){//没有超出最长，不用加位置
}else {//超出最长需要加链表长度
}
}

}else {//不进位
}
}
}
}

#### Leetcode第二题解题java实现

2015-05-25 10:42:41

#### leetcode 1. Two Sum -----java

2016-06-20 19:52:04

#### leetcode 第二题Add Two Numbers java

2015-03-09 11:33:12

2016-11-16 22:06:30

2015-07-16 07:10:21

#### 【LeetCode】2. Add Two Numbers 解题报告

2016-10-24 19:46:34

#### [LeetCode] 002. Add Two Numbers (Medium) (C++/Java/Python)

2015-02-27 12:43:08

2017-06-04 14:55:04

2016-11-21 12:05:45

#### LeetCode Add Two Numbers 之JavaScript 多种解法

2017-07-13 12:45:21