problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::best_time_to_buy_and_sell_stock_with_transaction_fee 命名空间参考

  1. 买卖股票的最佳时机含手续费
更多...

class  Solution
 

函数

 TEST (best_time_to_buy_and_sell_stock_with_transaction_fee, case1)
 
 TEST (best_time_to_buy_and_sell_stock_with_transaction_fee, case2)
 

详细描述

  1. 买卖股票的最佳时机含手续费

函数说明

◆ TEST() [1/2]

leetcode::best_time_to_buy_and_sell_stock_with_transaction_fee::TEST ( best_time_to_buy_and_sell_stock_with_transaction_fee  ,
case1   
)

在文件 leetcode_test.cpp4014 行定义.

4014 {
4015 vector prices = {1, 3, 2, 8, 4, 9};
4016 ASSERT_EQ(8, Solution::maxProfit(prices, 2));
4017 }

引用了 leetcode::best_time_to_buy_and_sell_stock_with_transaction_fee::Solution::maxProfit().

◆ TEST() [2/2]

leetcode::best_time_to_buy_and_sell_stock_with_transaction_fee::TEST ( best_time_to_buy_and_sell_stock_with_transaction_fee  ,
case2   
)

在文件 leetcode_test.cpp4019 行定义.

4019 {
4020 vector prices = {1, 3, 7, 5, 10, 3};
4021 ASSERT_EQ(6, Solution::maxProfit(prices, 3));
4022 }

引用了 leetcode::best_time_to_buy_and_sell_stock_with_transaction_fee::Solution::maxProfit().