Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2015-02-02 14:03:33
阅读次数:
101
Q: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....
分类:
其他好文 时间:
2015-02-01 19:13:07
阅读次数:
163
求解回文字符串:这道题是查找资料才得到的解法。具体思路如下:比如对字符串abcba,做如下处理#a#b#c#b#a#,目的是消除偶数的回文。计算一点的回文长度时,根据保存的前端的最大回文长度和中心点,判断当前点应该是从0开始计算,还是可以根据利用以前的结果。主要就是这个思路。class Soluti...
分类:
其他好文 时间:
2015-02-01 13:27:48
阅读次数:
173
1.indexOf() 方法 -----这个方法比较常用返回某个指定的字符串值在字符串中首次出现的位置使用格式:stringObject.indexOf(substring, startpos)举个例子:寻找第二个o所在的位子var mystr="Hello World!" document.wri...
分类:
编程语言 时间:
2015-01-31 17:41:50
阅读次数:
158
1.调用系统函数生成全球唯一标识Guid.NewGuid().ToString();2.生成16组十六进制数 string randmData=Guid.NewGuid().ToString().Substring(24,12)+Guid.NewGuid().ToString(...
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...
分类:
其他好文 时间:
2015-01-31 14:27:15
阅读次数:
145
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:
其他好文 时间:
2015-01-31 11:54:13
阅读次数:
202
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'30: Substring with Concatenation of All Wordshttps://oj.leetcode.com/problems/substring-wi...
分类:
编程语言 时间:
2015-01-31 00:09:50
阅读次数:
173
函数:1、从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstract from my_content_t 2、从右开始截取字符串 right(str, length) 说明:ri...
分类:
数据库 时间:
2015-01-30 17:31:03
阅读次数:
202
原题地址最初的想法是用动态规划,令palin[i][j]表示s[i..j]是否是回文串,则有递推公式palin[i][j] = s[i] == s[j] && palin[i+1][j-1]。因为递推式只使用相邻层的值,所以编码的时候可以将二维状态数组压缩成一维的。代码: 1 string long...
分类:
其他好文 时间:
2015-01-30 17:03:05
阅读次数:
105