Palindrome Partitioning问题:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partiti...
分类:
其他好文 时间:
2015-03-14 13:41:00
阅读次数:
108
(Version 0.0)这道题是在Palindrome Partitioning的基础之上要求找一个最少分割次数的partitioning,因为之前已经做过了Palindrome Partitioning,所以最开始自然想到了用DP记录所有substring是否是palindrome,然后再对每个...
分类:
其他好文 时间:
2015-03-13 07:04:57
阅读次数:
137
subString是String的一个方法,格式为:public String substring(int beginIndex, int endIndex)返回一个新字符串,它是此字符串的一个子字符串。该子字符串从指定的 beginIndex 处开始,一直到索引 endIndex - 1 处的字符...
分类:
其他好文 时间:
2015-03-12 23:50:18
阅读次数:
6456
1.字符串:string s1 = "test";string s2 = "test";string s3 = "test1".Substring(0, 4);object s4 = s3;Console.WriteLine("{0} {1} {2}", object.ReferenceEquals...
/** * 将15位转换为18位 * @param idCode 15位身份证号 * @return String 18位身份证号 */public String toEighteen(String idCode) { idCode = idCode.substring(0, 6) ...
分类:
编程语言 时间:
2015-03-12 15:03:01
阅读次数:
154
(Version 0.0)这题的思路比较straightforward,可以看出会有overlapping的子问题,因此可以先按DP做法用一个二维数组存储对于某一substring是不是palindrome的判断,然后做backtracking时可以利用这个DP二维数组的结果来跳过重复的palind...
分类:
其他好文 时间:
2015-03-12 11:07:43
阅读次数:
158
(Version 0.0)Interleaving String这道题是一道典型的DP题目,思路就是最基本的利用前一个subproblem(substring)的解加上对当前char的判断来解决当前问题的典型的sequence DP问题。我们要考虑的一般性的子问题是:取s1.substring(i)...
分类:
其他好文 时间:
2015-03-12 06:24:57
阅读次数:
172
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-03-11 21:29:40
阅读次数:
112
问题:JAVA实现String的第一个字母大写解决方案:toUpperCase()string.substring(0,1).toUpperCase()+string.substring(1,string.length());
分类:
编程语言 时间:
2015-03-11 15:07:58
阅读次数:
134
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA...