Problem:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique lo...
分类:
其他好文 时间:
2014-10-11 02:20:24
阅读次数:
227
1.substrsubstr(start,length)表示从start位置开始,截取length长度的字符串。var src="images/off_1.png";alert(src.substr(7,3));弹出值为:off2.substringsubstring(start,end)表示从st...
分类:
Web程序 时间:
2014-10-10 20:52:04
阅读次数:
186
/*1. 截取指定位置的字符串*/ StringUtils.substring("dskabcee", 3); /*结果是:jjjjj*/ StringUtils.substring("dskabcee", 3, 5); /*结果是:ab*/ ...
分类:
其他好文 时间:
2014-10-10 18:18:14
阅读次数:
179
这题看起来挺简单的,就是存一个哈希表,然后依次遍历整个字符串,遇到前面有过的字符的时候,就该停止当前计数,新的子串应该从发现该字符的位置的下一位置开始。我开始写了一个简单的写法,发现超时了: if (s.empty()) return 0; if (s.length() == 1) retur.....
分类:
其他好文 时间:
2014-10-10 14:28:10
阅读次数:
160
感觉上MySQL的字符串函数截取字符,比用程序截取(如PHP或JAVA)来得强大,所以在这里做一个记录,希望对大家有用。 函数: 1、从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstr...
分类:
数据库 时间:
2014-10-10 12:21:44
阅读次数:
324
题目链接:
here
题意:
和hdu4742类似。区别就是一部分三元组是直接给出的。还有一部分是用他给的那个函数生成的。还有就是这里的大于是严格的大于a>b必须ax>bx,ay>by,az>bz。
思路:
思路也和hdu4742here类似。只是有几个比较棘手的问题。现在变成严格大于了。对于y还是很好办的。我们在排序y的时候可以使的标号大的排在前面这样就可以防止y和它一样的更新它了...
分类:
其他好文 时间:
2014-10-10 02:52:43
阅读次数:
235
File file=new File("E:\\aa.jpg");
String fileName=file.getName();
String fileTyle=fileName.substring(fileName.lastIndexOf("."),fileName.length());
System.out.println(fileTyle);
程序运行效果图:...
分类:
编程语言 时间:
2014-10-09 20:49:27
阅读次数:
239
[leetcode]
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring....
分类:
其他好文 时间:
2014-10-09 17:06:08
阅读次数:
187
class Solution: # @return a string def longestCommonPrefix(self, strs): num_items=len(strs) if num_itemslen(i): pre...
分类:
其他好文 时间:
2014-10-09 15:05:24
阅读次数:
179
Problem:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating le...
分类:
其他好文 时间:
2014-10-09 13:49:13
阅读次数:
213