Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2015-02-10 14:45:36
阅读次数:
169
Write a function to find the longest common prefix string amongst an array of strings.class Solution {public: string longestCommonPrefix(vector &st...
分类:
其他好文 时间:
2015-02-10 14:41:50
阅读次数:
157
String fileUrl = request.getRequestURL().substring(0, request.getRequestURL().indexOf("/rest")) + "/...
分类:
Web程序 时间:
2015-02-10 13:11:43
阅读次数:
187
// 获取文件名称后缀 、不带后缀function getFilePath(filePath){ var path = []; var pos = filePath.lastIndexOf('.'); path['fileExt'] = filePath.substring(pos...
分类:
Web程序 时间:
2015-02-10 10:31:02
阅读次数:
171
方法一:暴力搜索针对S中每个字符开始搜索一次长度为wordLen*len的字符串,是否包含L中的所有单词。这个很好统计,Map就可以直接搞定。思路很好想,同时也很费时。超时class Solution { map m_map; public: void initMap(ve...
分类:
其他好文 时间:
2015-02-09 19:49:33
阅读次数:
116
擦!leetcode题目:Longest Substring Without Repeating Characters...
分类:
其他好文 时间:
2015-02-09 18:33:02
阅读次数:
114
String str_f = str.substring(0, 1); int i = (Integer.parseInt(str.substring(1)) + 1); // 数字补齐0 DecimalFormat df = new DecimalFormat("0000"); Stri...
分类:
编程语言 时间:
2015-02-09 17:34:24
阅读次数:
193
众所周知,JDK中以前String类中的substring方法存在内存泄漏问题,之所以说是以前,是因为JDK1.7及以后的版本已经修复了,我看都说JDK1.6的版本也存在这个问题,但是我本机上安装的1.6看了看源码不存在内存泄漏问题啊,又看了1.7的源码,和我本机的1.6的一样,是不是我的1.6版版其实是1.7的?!唉,不管了,反正1.7版本肯定没有这个问题(1.5及更老版本肯定有)了,大家就放心...
分类:
其他好文 时间:
2015-02-09 09:32:02
阅读次数:
134
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.例如:string s="aqaqedadcdccd";使用一个map fmap记录每个字符出现的个数,详解在程序中注释。int lengthOfLongestSubstringTwoDistinct(st...
分类:
其他好文 时间:
2015-02-08 23:12:12
阅读次数:
150
dns-update-style interim; ignore client-updates; allow booting; allow bootp; class "pxeclients" { match if substring(option vendor-class-identifier, 0...
分类:
其他好文 时间:
2015-02-08 19:30:04
阅读次数:
131