动态规划
文章平均质量分 64
小飞侠0070
是谁来自山川湖海,却囿于厨房,昼夜与爱
展开
-
139. Word Break 动态规划
Given a string s and a dictionary of words dict, determine ifs can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet",原创 2016-04-30 13:29:06 · 333 阅读 · 0 评论 -
343. Integer Break
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, retur原创 2016-04-30 22:05:12 · 184 阅读 · 0 评论 -
121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),原创 2016-06-08 15:41:03 · 174 阅读 · 0 评论