题目地址: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/ 题目描述: ... 解决方案: 当前值减之前的数中的最小值得当前值最大利润,再更新最大利润即可 代码: ...
分类:
其他好文 时间:
2018-04-22 21:49:21
阅读次数:
210
MIT IMO it is the less restrictive license. It gives the rights to anyone to use, copy, modify, merge, publish, distribute, sublicense, and/or sell co ...
分类:
其他好文 时间:
2018-04-22 10:49:38
阅读次数:
232
20165225《Java程序设计》第八周学习总结 1.视频与课本中的学习: 第十二章学习总结 2.代码托管: 3.上周错题总结: 4.学习心得: 线程死亡的时候,我也死亡了。 周末愉快。 please buy No Tears Left to Cry on itunes!?(′▽`) ...
分类:
编程语言 时间:
2018-04-21 12:09:24
阅读次数:
207
Advanced CPU Manufacturer (ACM) is one of the best CPU manufacturer in the world. Every day, they manufacture n CPU chips and sell them all over the w ...
分类:
其他好文 时间:
2018-04-15 11:49:31
阅读次数:
199
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 complet ...
分类:
其他好文 时间:
2018-04-14 13:47:05
阅读次数:
792
题目描述 Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest ...
分类:
其他好文 时间:
2018-04-10 21:56:10
阅读次数:
292
最近开始刷LeetCode,准备按照专题来进行。所有的解题方案我都会放在GitHub上面,对于有价值的题目,我会重新在这里做记录,并且将解题方案贴出来,便于自己之后复习。 Array 1. easy 1. "122. Best Time to Buy and Sell Stock II" + "我的 ...
分类:
其他好文 时间:
2018-04-06 15:29:02
阅读次数:
122
假设你有一个数组,其中第 i 个元素是一支给定股票第 i 天的价格。如果您只能完成最多一笔交易(即买入和卖出一股股票),则设计一个算法来找到最大的利润。示例 1:输入: [7, 1, 5, 3, 6, 4]输出: 5最大利润 = 6-1 = 5(不是 7-1 = 6, 因为卖出价格需要大于买入价格) ...
分类:
其他好文 时间:
2018-04-05 14:30:41
阅读次数:
144
步骤: 1、申请ssl证书,我在腾讯云(地址:https://buy.cloud.tencent.com/ssl)上找到的,其他的百度云、阿里云之类的应该都有,操作很简单,前提是要有一个已经备案过的域名。 2、等待审核,时间不会很久,比工信部备案域名快多了,域名备案了不到三个星期才通过。这个审核大概 ...
分类:
其他好文 时间:
2018-04-05 11:46:01
阅读次数:
184
A. Ability Draft 记忆化搜索。 B. Short Random Problem 留坑。 C. Block, Stock and Two Smoking Galaxy Notes 枚举领导者$S$,它需要满足度数至少为$\frac{n}{2}$。 枚举完领导后,将和$S$认识和不认识的 ...
分类:
其他好文 时间:
2018-04-02 01:06:59
阅读次数:
395