2014年(53)
发布时间:2014-10-07 14:07:10
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest product = 6.求一串数字的最大子串积。这不禁让人想到了最大子串和的那个问题,不.........【阅读全文】
发布时间:2014-10-02 22:13:11
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).就是两个有序数组,求它们组合成的有序数组的中位数。当然,可以根据我的另一篇博文“两个等长有序数组的中位数”介绍的原理来求,但是。。。.........【阅读全文】
发布时间:2014-09-24 22:51:04
Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The function prototype should be.........【阅读全文】
发布时间:2014-09-23 18:05:57
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return 1&n.........【阅读全文】
发布时间:2014-09-22 18:48:33
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be changed at a timeEach intermediate word must exist in the dictionaryFor example,Given:start =&n.........【阅读全文】