Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:
编程语言 时间:
2015-08-26 19:56:50
阅读次数:
156
palindromeQuestion 1Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length o...
分类:
其他好文 时间:
2015-08-26 01:31:55
阅读次数:
113
Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the...
分类:
其他好文 时间:
2015-08-25 20:59:06
阅读次数:
112
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
Gaps in auto-increment values for“bulk inserts”Withinnodb_autoinc_lock_modeset to 0 (“traditional”) or 1 (“consecutive”), the auto-increment values g....
分类:
数据库 时间:
2015-08-21 11:15:51
阅读次数:
273
最长上升公共子序列(Longest Increasing Common Subsequence,LICS)也是经典DP问题,是LCS与LIS的混合。Problem求数列 a[1..n], b[1..m]的LICS的长度, a[], b[]数组的元素均为正整数。Solution考虑如何定义DP状态,定...
分类:
其他好文 时间:
2015-08-20 01:04:36
阅读次数:
159
1、题目名称 Consecutive Numbers(找出连续出现的数字) 2、题目地址 https://leetcode.com/problems/consecutive-numbers/ 3、题目内容 写一个SQL,查出表Logs中连续出现至少3次的数字: +----+-----+
|?Id?|...
分类:
其他好文 时间:
2015-08-19 23:51:13
阅读次数:
254
背景
最近开始研究算法,于是在leetcode上做算法题,第五题Longest Palindromic Substring便是关于回文子串的。
什么是回文子串
回文字符串是指将该字符串前后颠倒之后和该字符串一样的字符串。例如:a,aaaa,aba,abba…
最长回文子串
要求最长回文子串,就需要遍历每一个子串,...
分类:
编程语言 时间:
2015-08-19 16:57:00
阅读次数:
171