摘要: Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs... 阅读全文
posted @ 2014-07-18 14:57 穆穆兔兔 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv... 阅读全文
posted @ 2014-07-18 11:09 穆穆兔兔 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 分析转载 http://blog.csdn.net/joylnwang/article/details/6859677Find the contiguous subarray within an array (containing at least one number) which has the... 阅读全文
posted @ 2014-07-17 14:59 穆穆兔兔 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
posted @ 2014-07-17 11:42 穆穆兔兔 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2014-07-07 17:02 穆穆兔兔 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol... 阅读全文
posted @ 2014-07-04 17:56 穆穆兔兔 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.思路:动态规划:f[i][j] 表示在第i行中以(i,j)点结束点... 阅读全文
posted @ 2014-07-04 10:36 穆穆兔兔 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 将Best Time to Buy and Sell Stock的如下思路用到此题目思路1:第i天买入,能赚到的最大利润是多少呢?就是i + 1 ~ n天中最大的股价减去第i天的。思路2:第i天买出,能赚到的最大利润是多少呢?就是第i天的价格减去0~ i-1天中最小的。和前两道题比起来的话,这道题最... 阅读全文
posted @ 2014-07-03 15:43 穆穆兔兔 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-07-03 14:48 穆穆兔兔 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2014-07-03 11:23 穆穆兔兔 阅读(202) 评论(0) 推荐(0) 编辑