Write a function to find the longest common prefix string amongst an array of strings. 大意就是,写一个函数可以找到一个数组字符串中的最长前缀。 分析: 最长前缀的最大值为数组字符串中长度最短的字符,由最短字符串由 ...
分类:
其他好文 时间:
2016-08-10 20:49:33
阅读次数:
142
这道题的关键点在于,对于字符串的赋值操作要谨慎,尽量采用记录下标的方式,而不是整个字符串的赋值,这样可以节省时间。 ...
分类:
其他好文 时间:
2016-08-09 18:51:00
阅读次数:
149
Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do ...
分类:
其他好文 时间:
2016-08-08 06:34:57
阅读次数:
147
A bit Greedy can achieve O(m) - the mid station between 2 adjacent cities has the longest distance within that range. ...
分类:
其他好文 时间:
2016-08-07 15:14:47
阅读次数:
208
Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc ...
分类:
其他好文 时间:
2016-08-07 06:24:00
阅读次数:
195
题意: Write a function to find the longest common prefix string amongst an array of strings. (Easy) 这两天实验室项目太忙了, 老板各种活,只能挑着先水几道easy题,这两个题是昨天做的没来得及写总结。 分 ...
分类:
其他好文 时间:
2016-08-05 23:05:21
阅读次数:
179
Given a string, find the length of the longest substring T that contains at most k distinct characters. For example, Given s = “eceba” and k = 2, T is ...
分类:
其他好文 时间:
2016-08-05 13:58:32
阅读次数:
164
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo ...
分类:
其他好文 时间:
2016-08-05 13:37:00
阅读次数:
103