题目:
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 ta...
分类:
其他好文 时间:
2014-06-28 08:17:11
阅读次数:
305
Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and ...
分类:
其他好文 时间:
2014-06-28 08:13:17
阅读次数:
249
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
/ ...
分类:
其他好文 时间:
2014-06-28 07:31:28
阅读次数:
214
我勒个去,上午刚搞好MySQL的编译安装,玛德一重启计算机然后重启服务又报错:[root@localhostmysql-5.5.13]#/usr/local/mysql/scripts/mysql_install_db--user=mysqlFATALERROR:Couldnotfind./bin/my_print_defaultsIfyoucompiledfromsource,youneedtorun‘makeinstall‘tocopyt..
分类:
其他好文 时间:
2014-06-28 06:21:53
阅读次数:
313
遍历目录中所有文件,并且统计文件类型。#!/bin/bash
#filename:filestat.sh
#set-x
if[$#-ne1];
then
echo$0basepath;
echo
fi
path=$1
declare-Astatarray;
whilereadline;
do
ftype=`file-b"$line"`
letstatarray["$ftype"]++;
done<<(find$path-typef-print)
ech..
分类:
其他好文 时间:
2014-06-28 00:16:08
阅读次数:
224
This question is not so difficult.
First,my thoughts were we should use a lot of code to find out the loop block,but there is no need to do that .
you just need to get every new position of char in ...
分类:
其他好文 时间:
2014-06-27 23:39:44
阅读次数:
293
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:
其他好文 时间:
2014-06-27 23:01:16
阅读次数:
259
find命令主要用来在硬盘上搜索文件格式:find 目录路径 选项 关键字 动作[-print -exec -ok ]find -name "t*" -perm 744查找当前目录下文件名以t开头的,且文件属性主具有读、写、执行权限的文件。。。。find还有-exec选项,对匹配文件执行该参数过给出...
分类:
其他好文 时间:
2014-06-27 22:42:03
阅读次数:
510
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:
其他好文 时间:
2014-06-27 22:25:10
阅读次数:
443
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sho...
分类:
其他好文 时间:
2014-06-27 22:24:34
阅读次数:
346