Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-11 21:29:40
阅读次数:
112
Longest Consecutive Sequence问题:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.思路: HashSet进行存储我的代码:....
分类:
其他好文 时间:
2015-03-11 21:23:53
阅读次数:
110
问题:JAVA实现String的第一个字母大写解决方案:toUpperCase()string.substring(0,1).toUpperCase()+string.substring(1,string.length());
分类:
编程语言 时间:
2015-03-11 15:07:58
阅读次数:
134
uva 10405 Longest Common SubsequenceSequence 1:Sequence 2:Given two sequences of characters, print the length of the longest common subsequence of both sequences. For example, the longest common subseq...
分类:
其他好文 时间:
2015-03-11 00:47:35
阅读次数:
140
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA...
LeetCode(4) || Longest Palindromic Substring 与 Manacher 线性算法题记本文是LeetCode题库的第五题,没想到做这些题的速度会这么慢,工作之余全部耗在这上面了,只怪自己基础差。本文主要介绍使用Manacher线性算法来求解字符串的最长回文子字符...
分类:
编程语言 时间:
2015-03-10 23:02:35
阅读次数:
203
函数void是没有返回值,括号内是参数private只能在当前类里面用,public公用的,可以在整个命名空间使用函数 函数创建与使用 示例一 身份证截取 static public string jiequ(string a) { string p = a.Substring(6, 8); C.....
分类:
其他好文 时间:
2015-03-10 22:58:42
阅读次数:
153
1.slice(); Array和String对象都有 在Array中 ?slice(i,[j])? i为开始截取的索引值,负数代表从末尾算起的索引值,-1为倒数第一个元素 j为结束的索引值,缺省时则获取从i到末尾的所有元素 参数返回: 返回索引...
分类:
其他好文 时间:
2015-03-10 19:55:12
阅读次数:
176
1.前端代码使用超链接到Struts的Action或Servlet请点击下载2.后台代码Action或ServletString s1=transUrl; // transUrl是前台接受的参数s1=s1.substring(6);s1=s1.substring(s1.indexOf("/"));S...
分类:
编程语言 时间:
2015-03-10 15:28:01
阅读次数:
181
var s = 'hello, world';s.charAt(0) // => "h":第一个字符s.charAt(s.length - 1); // => "d":最后一个字符s.substring(1, 4); // => "ell": 第2~4个字符(含首不含尾)s.slice(1, 4);...
分类:
其他好文 时间:
2015-03-10 13:41:09
阅读次数:
115