Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-04-18 23:29:41
阅读次数:
123
C#几个经常用到的字符串截取一、1、取字符串的前i个字符(1)string str1=str.Substring(0,i);(2)string str1=str.Remove(i,str.Length-i);2、去掉字符串的前i个字符string str1=str.Remove(0,i);strin...
题意:在一堆无序元素中找到最长的连续串的长度,要求时间复杂度O(N)
思路:首先将元素放到set集合中,然后再判断,每次判断是否包含某元素的复杂度为O(1)
代码:
public int longestConsecutive(int[] num) {
int currLen = 0, longestLen = Integer.MIN_VALUE;
Se...
分类:
其他好文 时间:
2015-04-18 10:09:13
阅读次数:
88
题目:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longe...
分类:
其他好文 时间:
2015-04-17 23:40:26
阅读次数:
127
题目的大意是:给出一序列,求出该序列的最长上升子序列的最大长度。
思路:
a: 1 7 3 5 9 4 8
dp: 1 2 2 3 4 3 4
#include
#include
using namespace std;
const int MAXN = 1005;
int main()
{
int n;
while( cin>>n )
{...
分类:
其他好文 时间:
2015-04-17 22:19:25
阅读次数:
169
Substring
时间限制:1000 ms | 内存限制:65535 KB
难度:1
描述
You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substring of ...
分类:
其他好文 时间:
2015-04-17 18:24:31
阅读次数:
128
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long...
分类:
其他好文 时间:
2015-04-17 17:52:17
阅读次数:
118
标量函数 1、大写:upper(); select upper(列名) from 表名; 2、小写:lower(); select lower(列名) from 表名; 3、截取字符串:substring(); select substring(列名,...
分类:
数据库 时间:
2015-04-17 15:27:59
阅读次数:
123
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 there exists one unique longest palindrom...
分类:
其他好文 时间:
2015-04-17 13:55:59
阅读次数:
162
Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters ...
分类:
其他好文 时间:
2015-04-16 21:54:27
阅读次数:
126