题目链接:https://oj.leetcode.com/problems/longest-palindromic-substring/
这道题通常可以写出来的是2种做法。
1. 保持一个index从前往后扫,每次index的循环中,保持left和right的index向两边扫,但是有2种情况,aba和abba。left和right的扫描要扫2次
2. DP做法,2维矩阵
* 可以...
分类:
其他好文 时间:
2015-01-07 15:00:44
阅读次数:
128
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...
分类:
其他好文 时间:
2015-01-06 23:07:00
阅读次数:
208
基础:1.囤位参数是字符串格式,如"A5/R8/D3",其中第一个字母是舱位信息,第二个参数是舱位数量,用Substring来截取字符串信息,来比较舱等和数量。 public String substring(int beginIndex, int endIndex) 第一个int为开始的索引,对应...
分类:
其他好文 时间:
2015-01-06 19:40:01
阅读次数:
128
其实就是拼接sql 拼接出来的select 'INSERT INTO [Gas_CN_Trade_B2C].[dbo].[Common_Street] values ('+convert(varchar(20),ID)+','+StreetName+','''+''''+','+substring(...
分类:
数据库 时间:
2015-01-06 15:11:54
阅读次数:
136
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:
其他好文 时间:
2015-01-06 11:37:18
阅读次数:
91
Given a string, find the length of the longest substring T that contains at most 2 distinct characters.
For example, Given s = “eceba”,
T is "ece" which its length is 3.
这题的线性解法是维护一个sliding w...
分类:
其他好文 时间:
2015-01-06 07:20:32
阅读次数:
121
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-01-05 00:18:13
阅读次数:
147
http://www.x.com/sections_intr.php?id=181andlength((database()))=4http://www.x.com/sections_intr.php?id=181andascii(substring((database()),1,1))=122http://www.x.com/sections_intr.php?id=181andascii(substring((database()),2,1))=122http://www.x.com/sections_i..
分类:
其他好文 时间:
2015-01-04 19:32:48
阅读次数:
248
sql中 substring和charindex 的用法
分类:
数据库 时间:
2015-01-04 16:31:26
阅读次数:
155
public class Solution { public int lengthOfLongestSubstring(String s) { int maxLen = 0; int maxLenTmp = 0; Map map = new HashMap( s.len...
分类:
其他好文 时间:
2015-01-04 11:03:57
阅读次数:
145