码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
leetcode4 ---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 for "abcabcbb" is "abc", which the length is 3. Fo...
分类:其他好文   时间:2015-03-22 10:40:52    阅读次数:321
LeetCode Algorithm 05
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2015-03-22 00:18:36    阅读次数:134
LeetCode Algorithm 03
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:其他好文   时间:2015-03-21 21:12:41    阅读次数:150
uva 10285 Longest Run on a Snowboard (记忆化搜索)
uva 10285 Longest Run on a Snowboard题目大意:给出一张n*m的雪地地图,每格标注的是该点的高度。从地势高的地方可以滑到地势低的地方(只能上下左右滑),问最长的滑雪距离。解题思路:逐一访问各点,若该点没有被访问过,则进行DFS找出该点为滑雪起始点的最长滑雪距离,用dp数组记录,若该点已被访问过,则返回其对应的dp数组记录的值。#include #i...
分类:其他好文   时间:2015-03-21 20:02:53    阅读次数:158
Leetcode: Longest Common Prefix
题目: Write a function to find the longest common prefix string amongst an array of strings. 即求给定的一组字符串的公共前缀。思路分析: 一个一个寻找前缀,先比较第一个和第二个,找到公共前缀,然后公共前缀和第三个比较,寻找公共前缀,以此类推。C++参考代码:class Solution { public:...
分类:其他好文   时间:2015-03-21 20:01:49    阅读次数:173
[JS做LeetCode] Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters </htm
分类:Web程序   时间:2015-03-21 18:29:41    阅读次数:147
HackerRank - The Longest Common Subsequence
Classic DP, and requires you to track optimal path.len1, len2 = map(int, raw_input().strip().split())a = map(int, raw_input().strip().split())b = map(...
分类:其他好文   时间:2015-03-21 15:26:57    阅读次数:199
poj 2533 Longest Ordered Subsequence(dp)
Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 36159   Accepted: 15882 Description A numeric sequence of ai is ordered if a1 a2 ...
分类:其他好文   时间:2015-03-21 09:49:34    阅读次数:118
Longest Consecutive Sequence
问题来源:https://leetcode.com/problems/longest-consecutive-sequence/import java.util.Arrays;/** * * * ClassName LongestConsecutiveSequence * * * Description Given an unsorted array of i...
分类:其他好文   时间:2015-03-20 16:26:45    阅读次数:115
LeetCode – Refresh – Longest Valid Parentheses
Notes:Do not forget to clean the total and rec. 1 class Solution { 2 public: 3 int longestValidParentheses(string s) { 4 int len = s.size(...
分类:其他好文   时间:2015-03-20 09:12:56    阅读次数:119
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!