Python支持5种数据类型,包括数字(numbers)、字符串(string)、列表(list)、元组(tuple)和字典(dictionary)。作为一门动态类型语言,不用去声明一个标示符的类型,使用的时候是什么类型会自动判定。对于定义好的变量,若不使用该变量,可以用del删除来释放占有的资源,...
分类:
编程语言 时间:
2014-07-16 22:52:11
阅读次数:
193
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-07-16 20:58:41
阅读次数:
173
《Windows Graphics Programming Win32 GDI and DirectDraw》6.1节中有这样的描述:The Windows NT/2000 graphics engine uses signed fixed-point numbers to represent co...
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 num...
分类:
其他好文 时间:
2014-07-16 19:53:49
阅读次数:
238
C#中定义数组--字符串及数组操作一、一维:int[] numbers = new int[]{1,2,3,4,5,6}; //不定长int[] numbers = new int[3]{1,2,3};//定长二、多维int[,] numbers = new int[,]{{1,2,3},{1,2,...
分类:
其他好文 时间:
2014-07-13 23:06:00
阅读次数:
215
public class Solution { public int longestConsecutive(int[] num) { HashSet hash=new HashSet(); int max=1; for(int n:num) ...
分类:
其他好文 时间:
2014-07-13 21:52:58
阅读次数:
244
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[...
分类:
其他好文 时间:
2014-07-13 16:01:42
阅读次数:
209
/*
B - Cow Multiplication
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit
Status
Practice
POJ 3673
Description
Bessie is tired of multiplying pairs of numbers th...
分类:
其他好文 时间:
2014-07-12 19:19:02
阅读次数:
164
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-07-12 19:06:27
阅读次数:
204
Problem Description
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime...
分类:
其他好文 时间:
2014-07-12 16:42:15
阅读次数:
271