TriangleGiven 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...
分类:
其他好文 时间:
2014-07-22 22:47:52
阅读次数:
230
题目: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 tw....
分类:
编程语言 时间:
2014-07-22 22:47:33
阅读次数:
256
题目: 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...
分类:
编程语言 时间:
2014-07-22 22:47:16
阅读次数:
252
The first solution I figured out is O(n^3). I thought it must be O(n^2) to get max points on a line for a given point.. but after checking several art...
分类:
其他好文 时间:
2014-07-22 22:47:15
阅读次数:
226
#includemain(){int n,i,sum;int x[10];while(scanf("%d %d %d %d %d %d",&x[1],&x[2],&x[3],&x[4],&x[5],&x[6])!=EOF){if(x[1]==0&&x[2]==0&&x[3]==0&&x[4]==0&...
分类:
其他好文 时间:
2014-07-22 22:46:14
阅读次数:
210
1、使用正则表达式进行URL匹配urlpatterns = patterns('', # ... (r'^time/plus/\d+/$', hours_ahead), # ...)(1)使用r代表字符串是原始字符串,表示python不会对立面的反斜杠\转义符进行处理,使用正则表达...
分类:
编程语言 时间:
2014-07-22 22:45:15
阅读次数:
235
SAD(Sum of Absolute Difference)=SAE(Sum of Absolute Error)即绝对误差和 SATD(Sum of Absolute Transformed Difference)即hadamard变换后再绝对值求和 SSD(Sum of Squared Dif...
分类:
其他好文 时间:
2014-07-22 22:43:32
阅读次数:
246
题目: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 integ....
分类:
编程语言 时间:
2014-07-22 22:42:33
阅读次数:
218
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".题解:简单的二进制加法模拟。a,b的最后以为对齐开始进行加法,用carries保存进位,如果加...
分类:
其他好文 时间:
2014-07-22 22:42:32
阅读次数:
196