2014年(53)
发布时间:2014-10-07 15:26:48
Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.H.........【阅读全文】
发布时间:2014-10-07 15:06:53
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 palindromic substring.首先我用了DP,没想到存储没报错,时间报错了,TLE了。原理是记录所有回文,然后更新最大值。比较值得注意.........【阅读全文】
发布时间:2014-10-07 14:55:35
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which has length = 2..........【阅读全文】
发布时间:2014-10-07 14:38:42
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BANC"..........【阅读全文】
发布时间:2014-10-07 14:29:36
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:.........【阅读全文】