摘要: 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-26 17:35 LeviCode 阅读(133) 评论(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-26 11:46 LeviCode 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 1 class Solution { 2 public: 3 int reverse(int x){ 4 ... 阅读全文
posted @ 2014-07-26 09:37 LeviCode 阅读(99) 评论(0) 推荐(0) 编辑