摘要: 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-12-28 17:35 雄哼哼 阅读(195) 评论(0) 推荐(0) 编辑
摘要: /*题目描述:从字典dict中找某些子串来组合成s思路:用dp来记录以序号i为结尾的字符串能否在字典中匹配成功。当有字符s[i]匹配不成功,而该字符前面的dp[j]出现了true,那么可以看是否有分割字符,即该j+1到i的子串看是否可以在字典中匹配。例如s="abcd" dict=[a,b,abc,... 阅读全文
posted @ 2014-12-28 16:38 雄哼哼 阅读(181) 评论(0) 推荐(0) 编辑