
LeetCode
勤奋的小芳芳
这个作者很懒,什么都没留下…
展开
-
[lettcode]2.两数相加
给你两个非空 的链表,表示两个非负的整数。它们每位数字都是按照逆序的方式存储的,并且每个节点只能存储一位数字。 请你将两个数相加,并以相同形式返回一个表示和的链表。 你可以假设除了数字 0 之外,这两个数都不会以 0开头。 示例 1: 输入:l1 = [2,4,3], l2 = [5,6,4] 输出:[7,0,8] 解释:342 + 465 = 807. 示例 2: 输入:l1 = [0], l2 = [0] 输出:[0] 示例 3: 输入:l1 = [9,9,9,9,9,9,...原创 2022-05-16 17:03:03 · 120 阅读 · 1 评论 -
【LeetCode】1. Two Sum
最近在学习LeetCode,写的有什么不合理的地方,欢迎留言指正。共同学习! Given an array of integers, return indices of the two numbers such that they add up to a specific target. 给定一个整数数组,数组中两个数字的和是某个特定的值,返回这两个数字的索引You may assume tha原创 2017-08-05 16:15:42 · 212 阅读 · 0 评论