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,...
分类:
其他好文 时间:
2014-05-27 02:42:35
阅读次数:
202
1.三种控制流语句:if\for\while2.每句后都要加冒号3.有elif语句=else后加一个if注意使用变量名!注意缩进!注意控制流语句后面要加冒号!4.for
i in range(0,5)5.break6.continue=================================...
分类:
编程语言 时间:
2014-05-27 01:01:56
阅读次数:
294
Questin:There is an array A[N] of N numbers.
You have to compose an array Output[N] such that Output[i] will be equal to
multiplication of all the ele...
分类:
其他好文 时间:
2014-05-23 23:48:14
阅读次数:
429
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 and return it as a link...
分类:
其他好文 时间:
2014-05-23 07:43:23
阅读次数:
246
题目:Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
罗马表示方式如下:
I = 1;
V = 5;
X = 10;
L = 50;
C = 100;
D = 500;
M = 1000;
其中每...
分类:
其他好文 时间:
2014-05-22 13:00:09
阅读次数:
240
??
Terrible Sets
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 2999
Accepted: 1549
Description
Let N be the set of all natural numbers {0 , 1 , 2 , . . . ...
分类:
其他好文 时间:
2014-05-22 09:52:10
阅读次数:
283
【题目】
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5...
分类:
其他好文 时间:
2014-05-22 06:44:39
阅读次数:
265
【题目】
Write a program to solve a Sudoku puzzle by filling the empty cells.
Empty cells are indicated by the character '.'.
You may assume that there will be only one unique solution.
A sudoku puzzle...
...and its solution numbers marked in red.
...
分类:
其他好文 时间:
2014-05-20 17:07:34
阅读次数:
335
题目链接 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 si...
分类:
其他好文 时间:
2014-05-19 13:53:32
阅读次数:
296
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 ...
分类:
其他好文 时间:
2014-05-19 12:05:23
阅读次数:
386