public int LengthOfLongestSubstring(string s) { Queue queue=new Queue(); int max=0; for(int i=0;i<s.Length;i++) { if(queue.Contain...
分类:
其他好文 时间:
2015-08-21 23:14:27
阅读次数:
148
A typical sliding window solution.class Solution { int rec[26]; // for a-z int rec1[26]; // for A-Z int cnt; int &getCnt(char c) ...
分类:
其他好文 时间:
2015-08-21 15:08:55
阅读次数:
146
Problem:https://leetcode.com/problems/substring-with-concatenation-of-all-words/You are given a string,s, and a list of words,words, that are all of t...
分类:
其他好文 时间:
2015-08-21 01:41:06
阅读次数:
173
Substring with Concatenation of All Words
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation...
分类:
其他好文 时间:
2015-08-20 19:09:31
阅读次数:
127
在工作中用到的例子:select * FROM [CSGDC.DataETLDB].[dbo].[StrategiesList] where strategy_name like '%基建系统%' and SUBSTRING(strategy_name,charindex('_',strat...
分类:
数据库 时间:
2015-08-20 18:32:34
阅读次数:
132
Java String 的replace 和replaceAll 都是用来替换srcString的subString,但是有些不同的是,replace的参数是字符或者字符串,而replaceAll的参数可以是正则表达式。 public?String?replace?(Char?old...
分类:
编程语言 时间:
2015-08-20 13:30:42
阅读次数:
163
${wjcd.lrsj}原来得到的是如2006-11-12 11:22:22.0${fn:substring(wjcd.lrsj, 0, 16)}使用functions函数来获取list的长度${fn:length(list)}fn:contains(string,substring) 假如參数s....
分类:
其他好文 时间:
2015-08-19 19:22:13
阅读次数:
117
背景
最近开始研究算法,于是在leetcode上做算法题,第五题Longest Palindromic Substring便是关于回文子串的。
什么是回文子串
回文字符串是指将该字符串前后颠倒之后和该字符串一样的字符串。例如:a,aaaa,aba,abba…
最长回文子串
要求最长回文子串,就需要遍历每一个子串,...
分类:
编程语言 时间:
2015-08-19 16:57:00
阅读次数:
171
1 题目
Given a string,find the length of the longest substring without repeating characters. Forexample, the longest substring without repeating letters for"abcabcbb" is "abc", which the length is 3. F...
分类:
其他好文 时间:
2015-08-19 11:14:04
阅读次数:
167
func?SubString(str?string,?begin,?end?int)?string?{
rs?:=?[]rune(str)
length?:=?len(rs)
if?begin?<?0?{
begin?=?0
}
if?begin?>=?length?{
return?""
}
if?end?>?len...
分类:
其他好文 时间:
2015-08-18 19:51:41
阅读次数:
96