File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Solve it & raise a Pull Request! 🎉
1010

1111
---
1212

13+
#7 This problem was asked by Affirm.
14+
15+
Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock. You're also given a number fee that represents a transaction fee for each buy and sell transaction.
16+
17+
You must buy before you can sell the stock, but you can make as many transactions as you like.
18+
19+
For example, given [1, 3, 2, 8, 4, 10] and fee = 2, you should return 9, since you could buy the stock at 1 dollar, and sell at 8 dollars, and then buy it at 4 dollars and sell it at 10 dollars. Since we did two transactions, there is a 4 dollar fee, so we have 7 + 6 = 13 profit minus 4 dollars of fees.
20+
21+
---
22+
1323
#6 This problem was asked by Stripe.
1424

1525
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

0 commit comments

Comments
 (0)