Leetcode
Miss_Molly
这个作者很懒,什么都没留下…
展开
-
leetcode001 Two sum
题目:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the ...原创 2018-05-09 16:33:33 · 137 阅读 · 0 评论 -
leetcode 002 Add Two Numbers
题目:leetcode 002 解题思路:链表题,要注意条件判断 ①t == 0的判断是为了5+5的情况,若无此判断 输出为0。 ②全为且,是要考虑到两个链表可能长度不一。若其中一个链表完成遍历,另外一个还有剩余仍要继续加。/** * Definition for singly-linked list. * struct ListNode { * int val; * ...原创 2018-06-29 09:55:14 · 154 阅读 · 0 评论 -
leetcode 2 Add Two Numbers
题目 leetcode2 add two numbers/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solut...原创 2018-06-29 10:00:34 · 204 阅读 · 0 评论