1.字符串的扩展与修复语言脚本都对字符串特别关注,有关的方法特别多,这些方法有三大类:第一类:与标签无关的实现:charAt,charCodeAt,concat,lastIndexOf,localeCompare,match,replace,slice,split,substr,substring,...
分类:
编程语言 时间:
2015-06-08 01:02:19
阅读次数:
162
Description
A substring of a string T is defined as:
T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.
Given two strings A, B and one integer K, we define S, a set of triples (i, j, k):
S = {(i, j, ...
分类:
编程语言 时间:
2015-06-07 23:41:18
阅读次数:
391
Well, there many ways to solve this problem. Let's first look at a naive solution.The basic idea is simple. Starting from the first character of the s...
分类:
其他好文 时间:
2015-06-07 21:31:03
阅读次数:
128
The prime 41, can be written as the sum of six consecutive primes:
41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest s...
分类:
其他好文 时间:
2015-06-07 17:35:13
阅读次数:
129
String to Integer (atoi)
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask you...
分类:
编程语言 时间:
2015-06-07 06:15:52
阅读次数:
181
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,...
分类:
其他好文 时间:
2015-06-06 21:57:41
阅读次数:
122
写该系列文章的目的是记录Guava源码中个人感觉不错且值得借鉴的内容。
一、MoreObjects类
//MoreObjects.ToStringHelper类的toString()方法:对于字符串拼接的写法蛮不错的,此前本人一直用比较挫的方式:不管三七二一,先拼接然后再subString()
@Override public String toString() {
/...
分类:
其他好文 时间:
2015-06-06 20:46:37
阅读次数:
311
题目:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which
the length is...
分类:
其他好文 时间:
2015-06-06 14:57:54
阅读次数:
120
Write a function to find the longest common prefix string amongst an array of strings.求最长公共前缀:以第一个字符串为模板比较之后的字符串即可。 1 public class Solution { 2 pu...
分类:
其他好文 时间:
2015-06-06 10:33:58
阅读次数:
102
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-06-06 10:25:13
阅读次数:
115