Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 ...
分类:
其他好文 时间:
2016-04-20 00:38:45
阅读次数:
179
Problem Description Now, here is a fuction:<br> F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)<br>Can you find the minimum value ...
分类:
其他好文 时间:
2016-04-20 00:18:47
阅读次数:
265
1.计算当前文件下的个数
ls-l|grep"^-"|wc-l
2.查看某服务是否开启
psaux|greptomcat
3.监听端口
lsof-i:端口
3.实时监测文件动态
tail-f-n400文件名
4.删除匹配到的文件
find/-name‘*file_name*’|xargsrm-f-r
5.删除目录M下n天前的日志
findM-mtime+n-name"*.*"-exec..
分类:
系统相关 时间:
2016-04-19 20:13:51
阅读次数:
178
用自己的代码去实现一个二叉搜索树类,对外提供常用的接口,比如insert、erase、size、find等等。...
分类:
其他好文 时间:
2016-04-19 20:03:32
阅读次数:
224
Problem Description
In the new year party, everybody will get a “special present”.Now it’s your turn to get your special present, a lot of presents now putting on the desk, and only one of them will b...
分类:
其他好文 时间:
2016-04-19 20:03:15
阅读次数:
304
3Sum Closest
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 integers. You may assume that each i...
分类:
其他好文 时间:
2016-04-19 19:55:38
阅读次数:
182
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d =
target? Find all unique quadruplets in the array which gives the sum of target.
Note:
...
分类:
其他好文 时间:
2016-04-19 19:51:42
阅读次数:
153
def search(data_set,find_num): mid = len(data_set) /2 print mid if len(data_set) == 1: if data_set[mid] == find_num: print ('End start: ',find_num) re ...
分类:
编程语言 时间:
2016-04-19 19:29:45
阅读次数:
224
题目:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the ...
分类:
其他好文 时间:
2016-04-19 19:26:17
阅读次数:
141
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 前缀和的应用,很简单。 ...
分类:
其他好文 时间:
2016-04-19 15:39:19
阅读次数:
274