题目链接:https://leetcode.com/problems/longest-palindromic-substring/
题目:
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and ...
分类:
其他好文 时间:
2016-05-30 14:53:40
阅读次数:
150
题目大意:给n个0~m之间的数,如果是0,那么0可以变为任意的一个1~m之间的一个数。从中选出若干个数,使构成一个连续的序列。问能构成的最长序列的长度为多少? 题目分析:枚举连续序列的起点,二分枚举二分序列的终点。 代码如下; ...
分类:
其他好文 时间:
2016-05-29 18:26:14
阅读次数:
150
This lesson will teach you about another horizontal combination operator: buffer and its variants. Buffer groups consecutive values together, emitting ...
分类:
Web程序 时间:
2016-05-27 19:58:02
阅读次数:
234
Anti-prime Sequences Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 3355 Accepted: 1531 Description Given a sequence of consecutive intege ...
分类:
其他好文 时间:
2016-05-27 14:26:09
阅读次数:
233
我的leetcode之旅,该篇章主要完成使用Java实现算法。这是第三篇Longest Substring Without Repeating Characters...
分类:
编程语言 时间:
2016-05-27 12:05:10
阅读次数:
166
这题实现起来还是挺麻烦的,就偷懒使用下库函数strtod()。第二个参数表示字符中不是数字的地方,如果后面是空格,则认为其仍是数字,否则不是。 bool isNumber(char *s) { char *endptr; strtod(s, &endptr); if (endptr == s)ret ...
分类:
其他好文 时间:
2016-05-25 18:39:39
阅读次数:
129
在一组字符串中找到最长的子串。采用纵向匹配,遇到第一个不匹配的停止。 string longestComPrefix(vector<string> &strs) { if (strs.empty())return " "; //纵向比较 for (int idx = 0; idx < strs[0] ...
分类:
其他好文 时间:
2016-05-25 18:39:27
阅读次数:
130
Problem: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the f ...
分类:
其他好文 时间:
2016-05-23 21:03:25
阅读次数:
113