Skip to content

Commit ca9bfa1

Browse files
refactor 309
1 parent d493ee5 commit ca9bfa1

File tree

1 file changed

+0
-15
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-15
lines changed

src/main/java/com/fishercoder/solutions/_309.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 309. Best Time to Buy and Sell Stock with Cooldown
5-
*
6-
* Say you have an array for which the ith element is the price of a given stock on day i.
7-
8-
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times) with the following restrictions:
9-
10-
You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).
11-
After you sell your stock, you cannot buy stock on next day. (ie, cooldown 1 day)
12-
Example:
13-
14-
prices = [1, 2, 3, 0, 2]
15-
maxProfit = 3
16-
transactions = [buy, sell, cooldown, buy, sell]
17-
*/
183
public class _309 {
194
public static class Solution1 {
205
/**

0 commit comments

Comments
 (0)