题目:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime comp....
分类:
编程语言 时间:
2014-07-27 10:43:42
阅读次数:
239
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-07-27 10:25:42
阅读次数:
179
maven在build构建时,加载资源文件时需要配置资源文件插件:1,在pom.xml文件中加入 ${project.build.target.file.name} ${basedir}/target ${basedir}/src/main/java ${basedir}...
分类:
移动开发 时间:
2014-07-27 10:10:22
阅读次数:
288
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2014-07-27 09:53:12
阅读次数:
350
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:
其他好文 时间:
2014-07-27 09:49:52
阅读次数:
237
用STL中的list写的,TLE
#include
#include
#include
#include
#include
using namespace std;
list l;
list::iterator it1,it2,it3,it4,it5,it;
void work(int a,int a1=1,int a2=1)
{
it1=find(l.begin(),l.end(...
分类:
其他好文 时间:
2014-07-26 17:23:02
阅读次数:
815
Compared with I version, the tree could be incomplete. The only difference is that, we connect current node's child to next non-childrenless' node's f...
分类:
其他好文 时间:
2014-07-26 17:02:11
阅读次数:
316
Problem Description:
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 number in C may only b...
分类:
其他好文 时间:
2014-07-26 15:24:02
阅读次数:
252
给定整数m,n和数组x[n],找出某个I,使得x[i]+x[i+1]+x[i+2]+x[i+3]+x[i+4]…x[i+m]最接近于零。
(0
一.暴力解法
遍历各个i值,计算子序列的和,然后求出最接近0的
int find(int a[],int n,int m) //寻找m+1个数字,使得他们的和最小
{
int i=0;
int thissum=0;
int j...
分类:
其他好文 时间:
2014-07-26 15:06:30
阅读次数:
233
Problem Description
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary.
Input
...
分类:
其他好文 时间:
2014-07-26 15:02:10
阅读次数:
220