作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 Python解法 C++ 解法 日期 [LeetCode] 题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Total Accepted: 98941 Total Submissions: 274449 Difficulty: Easy 题目描述 S…
You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum p…
Best Time to Buy and Sell Stock 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 (i.e., buy one and sell one share of the stock), design an algorith…
@requires_authorization @author johnsondu @create_time 2015.7.22 19:04 @url [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) /************************ * @description: dynamic programming. * 从前后…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/description/ 题目描述 Say you have an array for which the ith element is the price of a given stock on day…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 动态规划 日期 题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/description/ 题目描述 Say you have an array for which the ith element is the price of a giv…
题目如下: Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer feerepresenting a transaction fee. You may complete as many transactions as you like, but you need to pay…
# 一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 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 (ie…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/description/ 题目描述 Say you have an array for which the ith element is the price of a given stock on day…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/#/description 题目描述 Say you have an array for which the ith element is the price of a given stock on day…