正确的写法:public static List> function(){ List> list = new ArrayList>(); return list; }错误写法1:public static List> function(){ List>...
分类:
其他好文 时间:
2015-08-05 06:37:10
阅读次数:
141
Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,...
分类:
其他好文 时间:
2015-08-05 06:36:21
阅读次数:
102
132 Palindrome Partitioning II这道题就是标识出s[i:j+1]是否为palindrome, 然后dp找出最小分割class Solution: # @param {string} s # @return {integer} def minCut(sel...
分类:
其他好文 时间:
2015-08-05 06:26:36
阅读次数:
110
题目是这样的,按照以下函数的结果写一个sub()方法:sub(1)(2)(3);/*return 6*/sub(2)(2)(3);/*return 10*/我的山寨做法: function sub(n){ return function(j){ return function(i){ c...
分类:
Web程序 时间:
2015-08-05 01:00:20
阅读次数:
165
Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i...
分类:
其他好文 时间:
2015-08-05 00:30:29
阅读次数:
146
题目Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”]....
分类:
其他好文 时间:
2015-08-04 23:09:52
阅读次数:
146
区间DP
贴个代码
#include
#include
#include
using namespace std;
int check(char a,char b)
{
if(a=='(' && b==')')
return 1;
if(a=='[' && b==']')
return 1;
return 0;
}
in...
分类:
其他好文 时间:
2015-08-04 23:00:57
阅读次数:
201
Two Sum
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 th...
分类:
其他好文 时间:
2015-08-04 23:00:26
阅读次数:
104
转换字节大小/** * 转换字节大小 * @param number $size * @return string */function transByte($size,$dec=2){//Byte,KB,MB,GB,TB,EB $arr=array('B','KB','MB','GB','T...
分类:
Web程序 时间:
2015-08-04 22:39:46
阅读次数:
140
Problem Definition:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Solution:要求把所有存在an...
分类:
其他好文 时间:
2015-08-04 22:31:31
阅读次数:
81