字符串:var s = "1,2,3,4,5,"目标:删除最后一个 ","方法:s=s.substring(0,s.Length-1);字符串:var s2 = "img/upload/123.jpg"目标:获取文件名(不包含后缀名)方法:s2=s2.substring(s2.lastIndexOf...
分类:
Web程序 时间:
2015-01-08 22:35:00
阅读次数:
478
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-01-08 20:06:49
阅读次数:
131
JS随机字符串Math.random().toString(16).substring(2); //8位Math.random().toString(36).substring(2); //16位JS最大值和最小值Math.max.apply(Math, [1,2,3]) //3Math.min.a...
分类:
Web程序 时间:
2015-01-08 17:50:30
阅读次数:
162
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:
其他好文 时间:
2015-01-08 13:09:06
阅读次数:
175
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2015-01-07 23:40:19
阅读次数:
305
1811. Longest Common SubstringProblem code: LCSA string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set o...
分类:
其他好文 时间:
2015-01-07 23:22:12
阅读次数:
154
//设置url中参数值function setParam(param,value){ var query = location.search.substring(1); var p = new RegExp("(^|)" + param + "=([^&]*)(|$)"); if(...
分类:
Web程序 时间:
2015-01-07 21:56:30
阅读次数:
171
2){ session.setAttribute("PROCESSING_BIZ_ENTITY",bizSegment.substring(0,3)); } } UserSecurityContext userSecurityContex...
分类:
Web程序 时间:
2015-01-07 20:29:28
阅读次数:
414
https://oj.leetcode.com/problems/longest-consecutive-sequence/http://blog.csdn.net/linhuanmars/article/details/22964467publicclassSolution{
publicintlongestConsecutive(int[]num){
//SolutionA:
//returnlongestConsecutive_Sort(num);
//SolutionB:
returnlonges..
分类:
其他好文 时间:
2015-01-07 19:03:11
阅读次数:
165
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"]...
分类:
编程语言 时间:
2015-01-07 18:54:40
阅读次数:
134