SUBLEX - Lexicographical Substring Searchno tagsLittle Daniel loves to play with strings! He always finds different ways to have fun with strings! Kno...
分类:
其他好文 时间:
2015-08-27 09:34:52
阅读次数:
173
【205-Isomorphic Strings(同构字符串)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】代码下载【https://github.com/Wang-Jun-Chao】原题 Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if...
分类:
编程语言 时间:
2015-08-27 07:11:50
阅读次数:
354
大意:给你一个串,如果这个串存在一个长度为n的前缀串,和长度为n的后缀串,并且这两个串相等,则输出他们的长度n。求出所有的长度n例如‘alala'. Potential prefix-suffix strings of S are {'a', 'ala', 'alala'}分析:考察对于next数组...
分类:
编程语言 时间:
2015-08-26 22:12:17
阅读次数:
164
题目链接:http://poj.org/problem?id=2406DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "de...
分类:
其他好文 时间:
2015-08-26 21:54:33
阅读次数:
137
首先通过 Project -> Localizations 添加支持的语言,默认会自动生产部分文件的多语言文件(Main.storyboard, LanuchStroyBoard.storyboard) 应用名: 创建InfoPlist的strings文件在对应的属性栏的Localizatio...
分类:
其他好文 时间:
2015-08-26 14:08:22
阅读次数:
124
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
Problem Description
CRB has two strings s and t.
In each step, CRB can select arbitrary character c of s and
insert any character d (d ≠ c)
just after it.
CRB wants to convert s to t.
But i...
分类:
其他好文 时间:
2015-08-21 23:28:03
阅读次数:
199
/**
* 功能:有个排序后的字符串数组,其中散布着一些空字符串,找出给定字符串的位置。
*/
/**
* 思路:对二分查找法做修改,与mid比较的地方,如果mid为空字符串,则将mid换到离它最近的非空字符串的位置。
* @param strings
* @param str
* @return
*/
public static int search(Strin...
分类:
编程语言 时间:
2015-08-21 11:28:07
阅读次数:
200
题意:有一个非空字符串S1只含有字符”a”,”b”。可将Si变为S(i+1),方法是将Si中的a全部变换为b,将b全部变换为a。现在给出了Sn和Sm的长度,分别为L1, L2,并且知道n, m,问是否存在一个合理的S1,如果存在, 求Sk的长度是多少(mod 1e9 + 7)。所有变量在(0, 1e9] 范围内。解法:设S1中含有n1个a和n2个b(n1 + n2 > 0),不难发现Si的n1和n2...
分类:
其他好文 时间:
2015-08-21 00:21:43
阅读次数:
193
题意:重复子串次数思路:kmp#include#include#includeusing namespace std;#define MaxSize 1000005int next[MaxSize];void GetNext(char t[]){//求next数组 int j,k,len; ...
分类:
其他好文 时间:
2015-08-20 22:27:52
阅读次数:
221