只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2015-03-28 15:52 hhboboy 阅读(32) 评论(0) 推荐(2) 编辑
摘要: 给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 示例: 输入:(2 -> 4 -> 阅读全文
posted @ 2020-02-04 19:06 hhboboy 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 num 阅读全文
posted @ 2020-01-03 00:39 hhboboy 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
posted @ 2017-06-04 16:02 hhboboy 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文
posted @ 2016-09-09 17:12 hhboboy 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2016-08-17 21:31 hhboboy 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2016-08-15 23:03 hhboboy 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. Credits:Special thanks to @mithmatt for adding this problem and cre 阅读全文
posted @ 2016-08-13 18:13 hhboboy 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, ex 阅读全文
posted @ 2016-08-13 16:49 hhboboy 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2 阅读全文
posted @ 2016-08-09 21:40 hhboboy 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; 8 */ 9 class Solutio... 阅读全文
posted @ 2016-07-19 22:20 hhboboy 阅读(440) 评论(0) 推荐(0) 编辑