Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2014-07-07 15:34:56
阅读次数:
160
You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenati...
分类:
其他好文 时间:
2014-07-06 19:09:21
阅读次数:
169
在一个字符串中求不重复子串的最大长度是一个经典的贪心法求解问题(说子串自然是连续的,子序列则不要求连续)。
先给出leetcode上这题的描述:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring wit...
分类:
其他好文 时间:
2014-07-03 16:24:55
阅读次数:
281
You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenati...
分类:
其他好文 时间:
2014-07-03 12:32:26
阅读次数:
133
1. 最笨的办法.......function get() { var s = 22.127456 + ""; var str = s.substring(0,s.indexOf(".") + 3); alert(str); }2. 正则 效果不错3. 他就比较聪明了.....4.会用新鲜东西的.....
分类:
Web程序 时间:
2014-07-03 10:39:46
阅读次数:
205
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...
分类:
其他好文 时间:
2014-07-02 16:35:32
阅读次数:
213
String的常用方法方法说明Anchor()创建html锚Concat()把字符串连接起来indexOf()查找字符出现的位置lastIndexOf()查找最后出现字符charAt()返回指定位置的字符Substring()截取字符串...
分类:
其他好文 时间:
2014-07-02 00:49:45
阅读次数:
315
substr 方法返回一个从指定位置开始的指定长度的子字符串。stringvar.substr(start [, length ])参数stringvar必选项。要提取子字符串的字符串文字或 String 对象。start必选项。所需的子字符串的起始位置。字符串中的第一个字符的索引为 0。lengt...
分类:
Web程序 时间:
2014-07-01 16:20:58
阅读次数:
253
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 "()...
分类:
其他好文 时间:
2014-07-01 09:09:06
阅读次数:
156
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...
分类:
其他好文 时间:
2014-06-30 22:43:45
阅读次数:
294