题目:Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exa...
分类:
其他好文 时间:
2015-07-14 20:17:02
阅读次数:
127
Question: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 fa...
分类:
其他好文 时间:
2015-07-14 17:15:29
阅读次数:
106
Problem DescriptionGiven a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba...
分类:
其他好文 时间:
2015-07-14 13:20:40
阅读次数:
95
题目:032 Longest Valid Parentheses这道题是典型的堆栈应用class Solution: # @param {string} s # @return {integer} def longestValidParentheses(self, s): ...
分类:
其他好文 时间:
2015-07-14 13:18:22
阅读次数:
102
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 longes...
分类:
其他好文 时间:
2015-07-14 09:48:50
阅读次数:
130
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-07-13 22:01:03
阅读次数:
106
leetcode longest-common-prefix
求出string中的最小长度
然后依次每个string从第一个开始进行比较...
分类:
其他好文 时间:
2015-07-13 12:20:32
阅读次数:
109
Longest Consecutive Sequence
首先补充一些map的用法begin,end,rbegin,rend,empty,clear,size,max_size 八个常用的函数.map.begin(); 是map的起始位置map.end(); 是指map的尾部,没有实际元素.map.find(); 查找函数map.rebgin()和.rend()是反向遍历数据的起始位置和终止位置...
分类:
其他好文 时间:
2015-07-13 12:06:26
阅读次数:
100
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. For “...
分类:
其他好文 时间:
2015-07-13 00:51:06
阅读次数:
112
Use the strs[0] as the reference string and then compare it with the remaining strings from left to right. Once we find a string with length less than...
分类:
其他好文 时间:
2015-07-12 15:26:17
阅读次数:
93