leet-code/src/main/java/leetcode/editor/cn/AddTwoNumbersIi.java
2021-04-29 23:21:52 +08:00

51 lines
1.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//给你两个 非空 链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储一位数字。将这两数相加会返回一个新的链表。
//
// 你可以假设除了数字 0 之外,这两个数字都不会以零开头。
//
//
//
// 进阶:
//
// 如果输入链表不能修改该如何处理?换句话说,你不能对列表中的节点进行翻转。
//
//
//
// 示例:
//
// 输入:(7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4)
//输出7 -> 8 -> 0 -> 7
//
// Related Topics 链表
// 👍 368 👎 0
package leetcode.editor.cn;
import com.code.leet.entiy.ListNode;
//445:两数相加 II
public class AddTwoNumbersIi {
public static void main(String[] args) {
//测试代码
Solution solution = new AddTwoNumbersIi().new Solution();
}
//力扣代码
//leetcode submit region begin(Prohibit modification and deletion)
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
return null;
}
}
//leetcode submit region end(Prohibit modification and deletion)
}