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 repeate...
分类:
其他好文 时间:
2014-08-24 23:34:33
阅读次数:
259
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 numb...
分类:
其他好文 时间:
2014-08-24 23:29:33
阅读次数:
176
暴力+构造
If r?-?l?≤?4 we can all subsets of size not greater than k.
Else, if k?=?1, obviously that answer is l. If k?=?2,
answer is 1, because xor of numbers 2x and 2x?+?1 equls 1.
If k?≥...
分类:
其他好文 时间:
2014-08-24 11:40:22
阅读次数:
233
Add Two Numbers
Total Accepted: 20255 Total
Submissions: 88115My Submissions
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a...
分类:
其他好文 时间:
2014-08-23 21:40:01
阅读次数:
200
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4.....
分类:
其他好文 时间:
2014-08-23 21:37:41
阅读次数:
199
#include void main() { int a[10]; int i,j,t; printf("input 10 numbers:\n"); for(i=0;ia[i+1]) /*相邻两个数比较,想降序只要改成a[i]<a[i+1]*/ { t=a[i]; a[i]=a[i+1]...
分类:
编程语言 时间:
2014-08-23 17:32:31
阅读次数:
157
Triangle
Total Accepted: 16109 Total
Submissions: 60327My Submissions
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row...
分类:
其他好文 时间:
2014-08-23 16:54:11
阅读次数:
253
Consider this sequence {1, 2, 3, … , N}, as a initial sequence of firstN natural numbers. You can rearrange this sequence in many ways. Therewill be
N! different arrangements. You have to calculate t...
分类:
其他好文 时间:
2014-08-23 15:27:01
阅读次数:
202
Remove Duplicates from Sorted List II
Total Accepted: 17137 Total
Submissions: 69046My Submissions
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only d...
分类:
其他好文 时间:
2014-08-23 14:00:40
阅读次数:
187
swift 中的闭包类似OC中的快代码和java 匿名内部类。它是预先定义了一段可以执行的代码,简单的可以将闭包看做是函数的一种简写example:将一个数组按照一定的函数映射成另一个数组有两种写法:普通函数的写法:var numbers = [20, 19, 7, 12]“numbers.map(...
分类:
编程语言 时间:
2014-08-23 00:58:49
阅读次数:
359