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-06-12 00:33:10
阅读次数:
122
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 farthest leaf node.求最大深度,用递归的方法/**
* Definition for a binary...
分类:
其他好文 时间:
2015-06-11 19:26:53
阅读次数:
126
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-06-11 18:25:40
阅读次数:
104
1318: [Spoj744] Longest PermutationTime Limit: 10 SecMemory Limit: 162 MBSubmit: 361Solved: 215[Submit][Status][Discuss]Description给你一个序列A含有n个正整数(1#in...
分类:
其他好文 时间:
2015-06-11 18:23:22
阅读次数:
141
题目描述Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longes...
分类:
其他好文 时间:
2015-06-11 12:36:10
阅读次数:
110
No.14 Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.求一组string的最长公共前缀想法:找到最短的那个,然后依次对比典型的字...
分类:
其他好文 时间:
2015-06-10 15:28:49
阅读次数:
107
leetcode中有几道题使用同一个思路,大致是先维护一个窗口,每次只移动窗口左侧或者右侧的边界,然后针对这个窗口内的元素进行处理。这种方式使用两个指针,可以将问题的运行时间降到O(n)内。Longest Substring Without Repeating Characters:https://...
分类:
其他好文 时间:
2015-06-10 06:34:45
阅读次数:
412
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 farthest le...
分类:
其他好文 时间:
2015-06-10 06:33:56
阅读次数:
99
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-06-09 16:59:44
阅读次数:
135
This problem has a long story. There are just too many solutions on the web and it can be studied for a long time before you fully grasp it. Morever, ...
分类:
其他好文 时间:
2015-06-08 22:53:39
阅读次数:
161