找出单词的最长公共前缀
class Solution {
public:
string longestCommonPrefix(vector &strs) {
int len=strs.size();
if(len==0)
return "";
int length=strs[0].size(),j;
...
分类:
其他好文 时间:
2014-05-22 09:35:20
阅读次数:
230
Fence Repair
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 24153
Accepted: 7703
Description
Farmer John wants to repair a small length of the fence aroun...
分类:
其他好文 时间:
2014-05-22 07:55:44
阅读次数:
255
返回目录为什么要对minLength和maxLength这两个方法进行扩展呢,是因为这样一个需求,在用户注册时,可以由用户自己决定他们输入的字符,中文,英文,数字均可,这样做了之后,使用户的体验更好,但对于程序来说就有些麻烦了,因为我们的Length方法只针对英文字符和数字而言的原因1:事实上,真实...
分类:
Web程序 时间:
2014-05-22 00:56:17
阅读次数:
334
1. Post: http://localhost:11804/My/Commentfor
plain html parameter submission, like the GET in URL:Request Header:User-Agent:
FiddlerContent-Length: 3...
分类:
其他好文 时间:
2014-05-21 20:54:49
阅读次数:
346
Given a sorted array, remove the duplicates in
place such that each element appear onlyonceand return the new length.Do not
allocate extra space for a...
分类:
其他好文 时间:
2014-05-21 20:00:51
阅读次数:
296
树的路径长度树的路径长度是从树根到树中每一结点的路径长度之和。在结点数目相同的二叉树中,完全二叉树的路径长度最短。树的带权路径长度(weighted path
length of tree,wpl)结点的权值:在一些应用中,赋予树中结点的一个有某种意义的实数、结点的带权路径长度:结点到树根之间的路径...
分类:
其他好文 时间:
2014-05-21 19:02:14
阅读次数:
305
public class setZero {
static void print(int [][]a){
for(int i=0;i<a.length;i++){
for(int j=0;j<a[i].length;j++){
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
/*stati...
分类:
其他好文 时间:
2014-05-21 16:16:56
阅读次数:
252
1,使用MD5,本地文件下载完后去文件的md5值与服务器的该文件md5进行比对,一致证明下载完全。2,比较文件的size,文件长度,下载完成取下File.length,与服务器的文件长度比对,一致则下载完全。3,文件命名法,开始下载时,把文件命名为宜别名如xxx.tmp,下载完成后再把文件名称修改过...
分类:
其他好文 时间:
2014-05-21 03:59:00
阅读次数:
197
表单验证
function check_1(param){//不为空
if(param==""||param==null){return false;}else{return true;}
}
function check_2(param){//长度限制,字母是10个,汉字也是10个
if(param.length>10){return false;}else...
分类:
Web程序 时间:
2014-05-20 17:15:45
阅读次数:
414
【题目】
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()", which has length = 2.
Another example is ")()())", whe...
分类:
其他好文 时间:
2014-05-20 16:39:07
阅读次数:
280