while用起来不如for安全。i = 0numbers = []while i < 6: print "At the top i is %d" % i numbers.append(i) i = i + 1 print "Numbers now: ", numbers print "At ...
分类:
其他好文 时间:
2014-10-25 11:48:19
阅读次数:
152
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
class Solution {
public:
std::str...
分类:
其他好文 时间:
2014-10-25 09:21:02
阅读次数:
155
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-10-24 23:30:05
阅读次数:
260
1 声明式:所谓声明式是告诉编译器某个东西的名称和类型,但忽略细节。下面都是声明式:extern int x; //对象(object)声明式 记住:变量的声明加extern关键字std::size_t numDigits(int numbers); //函数(fu...
分类:
编程语言 时间:
2014-10-24 22:05:51
阅读次数:
325
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-10-24 18:14:00
阅读次数:
183
Give Me the NumberTime Limit: 2 Seconds Memory Limit: 65536 KBNumbers in English are written down in the following way (only numbers less than 109 ...
分类:
其他好文 时间:
2014-10-24 14:14:20
阅读次数:
342
Humble Numbers
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 17723 Accepted Submission(s): 7706
Problem Description
A number whose...
分类:
其他好文 时间:
2014-10-23 22:48:59
阅读次数:
566
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-10-23 22:15:45
阅读次数:
130
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,1].
class Solutio...
分类:
其他好文 时间:
2014-10-23 12:33:50
阅读次数:
223
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
and [2,1,1]....
分类:
其他好文 时间:
2014-10-23 12:29:48
阅读次数:
136