![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法分析与实现
文章平均质量分 84
hooha
这个作者很懒,什么都没留下…
展开
-
3Sum Closest
3Sum Closest Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each in原创 2012-08-13 14:07:06 · 3306 阅读 · 0 评论 -
Combination Sum
Combination Sum 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 repeated number may be c原创 2012-08-23 01:45:34 · 8825 阅读 · 3 评论 -
Permutations
Permutations Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,原创 2012-08-23 00:36:52 · 813 阅读 · 0 评论 -
Anagrams
Anagrams Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. 什么是anagrams? /** 整理的提交代码 * 处理复杂度为O(n),n是字符串个数,但是其中有排序等步骤没有固原创 2012-08-14 19:24:10 · 904 阅读 · 0 评论 -
Climbing Stairs
Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? /** 整理的原创 2012-08-14 20:50:19 · 642 阅读 · 0 评论 -
Add Two Numbers
Add Two Numbers 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原创 2012-08-14 15:33:33 · 712 阅读 · 0 评论 -
4Sum
4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. No原创 2012-08-13 19:14:22 · 1672 阅读 · 0 评论 -
Add Binary
Add Binary Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". /** 整理的提交代码 * 处理复杂度为O(max(n1,n2)) * 主要思路: * 1、先处理特殊情况,有其中一个为空,则原创 2012-08-13 23:33:01 · 2166 阅读 · 0 评论 -
3Sum
3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in原创 2012-08-12 17:16:56 · 6560 阅读 · 0 评论 -
Combination Sum II
Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may on原创 2012-08-23 02:55:49 · 2427 阅读 · 0 评论