Best Time to Buy and Sell Stock
2015-09-14 08:42
239 查看
Say you have an array for which the i-th element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the
stock), design an algorithm to find the maximum profit.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the
stock), design an algorithm to find the maximum profit.
相关文章推荐
- iOS开发网络数据之AFNetworking使用
- [置顶] 给IOS初学者及新手的建议
- modelandview 与modelmap
- Word Search
- Pow(x,n)
- Sqrt(x)
- 类和接口
- Sudoku Solver
- 一个关于autoLayout的非常详细的操作
- java计算两个时间相差(天、小时、分钟、秒)
- Generate Parentheses
- Restore IP Addresses
- Combination Sum
- Combination Sum II
- 新浪微博-02搭建主框架
- N-Queens
- N-Queens II
- 关于 32位 机的 C的数据类型占字节数
- Nodejs课堂笔记-第六课 在DynamoDB中如何创建表
- 第二周【项目0】 宣告主权