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

  1. 最佳买卖股票时机含冷冻期
更多...

class  Solution
 

函数

 TEST (best_time_to_buy_and_sell_stock_with_cooldown, case1)
 
 TEST (best_time_to_buy_and_sell_stock_with_cooldown, case2)
 
 TEST (best_time_to_buy_and_sell_stock_with_cooldown, case3)
 

详细描述

  1. 最佳买卖股票时机含冷冻期

函数说明

◆ TEST() [1/3]

leetcode::best_time_to_buy_and_sell_stock_with_cooldown::TEST ( best_time_to_buy_and_sell_stock_with_cooldown  ,
case1   
)

在文件 leetcode_test.cpp3997 行定义.

3997 {
3998 vector prices = {1, 2, 3, 0, 2};
3999 ASSERT_EQ(3, Solution::maxProfit(prices));
4000 }

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

◆ TEST() [2/3]

leetcode::best_time_to_buy_and_sell_stock_with_cooldown::TEST ( best_time_to_buy_and_sell_stock_with_cooldown  ,
case2   
)

在文件 leetcode_test.cpp4002 行定义.

4002 {
4003 vector prices = {1};
4004 ASSERT_EQ(0, Solution::maxProfit(prices));
4005 }

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

◆ TEST() [3/3]

leetcode::best_time_to_buy_and_sell_stock_with_cooldown::TEST ( best_time_to_buy_and_sell_stock_with_cooldown  ,
case3   
)

在文件 leetcode_test.cpp4007 行定义.

4007 {
4008 vector prices = {1, 2};
4009 ASSERT_EQ(1, Solution::maxProfit(prices));
4010 }

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