因为要删去1个串(读错题),所以就直接二分搞就好了。 需要预处理出2个分别从头到尾,或从尾到头需要多长a串的数组,然后二分删去多长就好了。 ...
分类:
其他好文 时间:
2017-02-04 15:14:09
阅读次数:
180
方法:暴力 / kmp 先说一下暴力的方法,就是尝试把原来的string不断分割,在substring 里求解。code 如下 然而看到题解,好像是用kmp,值得学习 http://www.cnblogs.com/jackge/archive/2013/01/05/2846006.html ...
分类:
其他好文 时间:
2017-01-30 16:19:06
阅读次数:
225
Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: [ ["ate", "eat","tea"], [" ...
分类:
其他好文 时间:
2017-01-27 07:16:25
阅读次数:
230
Educational Codeforces Round 17 C. Two strings 题意:两个字符串A,B,从B中删除尽可能少的子串,要使得B剩下的字符串是A的子序列,输出B剩下的字符串。(注意子串与子序列区别) 总结:看了某神犇的代码,不太理解。。官方题解:不要去想从B中删掉子串,应该想 ...
分类:
其他好文 时间:
2017-01-26 18:58:03
阅读次数:
218
题目: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter ...
分类:
其他好文 时间:
2017-01-25 14:25:48
阅读次数:
187
字符串 Strings JavaScript没有,字符,类型。仅包含一个字符的,字符串即可。 对象Objects JavaScript的简单数据类型:数字、字符串、布尔值、null值和undefined值,其他所有值都是对象。数字、字符串、布尔值“貌似”对象,因为它们拥有方法,但是,它们是不可变的! ...
分类:
编程语言 时间:
2017-01-22 15:14:31
阅读次数:
198
iOS字符本地化 1.本地化资源库 1.1.新建Bundle作为本地化资源库 1.2.将本地化资源库改成如下 1.3.配置各个语言的本地字符(Localizable.strings)资源 //英语 "Group" = "Group"; "Name" = "Name"; //简体中文 "Group" ...
分类:
移动开发 时间:
2017-01-20 16:01:35
阅读次数:
216
类型后面三个点(String...),是从Java 5开始,Java语言对方法参数支持一种新写法,叫可变长度参数列表,其语法就是类型后跟...,表示此处接受的参数为0到多个Object类型的对象,或者是一个Object[]。 例如我们有一个方法叫做test(String...strings),那么你 ...
分类:
编程语言 时间:
2017-01-20 13:08:14
阅读次数:
247
com.google.common.base.Strings public static String nullToEmpty(String string) public static boolean isNullOrEmpty(String string) public static String ...
分类:
编程语言 时间:
2017-01-18 12:33:06
阅读次数:
147
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the ...
分类:
其他好文 时间:
2017-01-18 12:05:01
阅读次数:
225