摘要: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文
posted @ 2015-09-10 20:54 舒克_贝塔 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2015-09-10 10:37 舒克_贝塔 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-09-10 09:22 舒克_贝塔 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1 bool is_sqrt(int n){ 2 for(int i=1;i=i/2;--j){23 a[i] = a[i]<(a[j]+a[i-j])?a[i]:(a[j]+a[i-j]);24 }25 }26 int temp =... 阅读全文
posted @ 2015-09-10 08:20 舒克_贝塔 阅读(718) 评论(0) 推荐(0) 编辑