2015年10月14日

91. Decode Ways (Array; DP)

摘要: A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta... 阅读全文

posted @ 2015-10-14 21:30 joannae 阅读(197) 评论(0) 推荐(0) 编辑

45. Jump Game II (Array; Two-Pointers,Greedy)

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文

posted @ 2015-10-14 21:25 joannae 阅读(188) 评论(0) 推荐(0) 编辑

70. Climbing Stairs (Array; DP)

摘要: You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文

posted @ 2015-10-14 18:59 joannae 阅读(138) 评论(0) 推荐(0) 编辑

123. Best Time to Buy and Sell Stock III (Array; DP)

摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文

posted @ 2015-10-14 18:55 joannae 阅读(193) 评论(0) 推荐(0) 编辑

122. Best Time to Buy and Sell Stock II (Array;Greedy)

摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文

posted @ 2015-10-14 18:45 joannae 阅读(164) 评论(0) 推荐(0) 编辑

121. Best Time to Buy and Sell Stock (Array;DP)

摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文

posted @ 2015-10-14 18:38 joannae 阅读(184) 评论(0) 推荐(0) 编辑

导航