Recall & Review
beginner Click to reveal answer
What is the main goal in the 'Buy and Sell Stocks' problem?
To find the maximum profit by choosing the best days to buy and sell stocks given their prices over time.
beginner Click to reveal answer
In the 'Buy and Sell Stocks I' variant, how many transactions are allowed?
Only one transaction is allowed: buy once and sell once.
intermediate Click to reveal answer
What is the key difference between 'Buy and Sell Stocks II' and 'Buy and Sell Stocks I'?
'Buy and Sell Stocks II' allows unlimited transactions (buy and sell multiple times), while 'I' allows only one transaction.
intermediate Click to reveal answer
What constraint does 'Buy and Sell Stocks with Cooldown' add?
After selling a stock, you must wait one day before buying again (cooldown period).
intermediate Click to reveal answer
In 'Buy and Sell Stocks with Transaction Fee', what effect does the fee have on profit calculation?
Each sell transaction reduces profit by the fee amount, so profit must be calculated after subtracting the fee.
In 'Buy and Sell Stocks I', what is the best approach to find maximum profit?
✗ Incorrect
Tracking the minimum price so far and calculating profit by selling at current price helps find the max profit with one transaction.
Which variant allows buying and selling stocks multiple times without restrictions?
✗ Incorrect
'Buy and Sell Stocks II' allows unlimited transactions without cooldown or fees.
What does the cooldown period prevent in the 'Buy and Sell Stocks with Cooldown' variant?
✗ Incorrect
Cooldown means you cannot buy a stock immediately after selling; you must wait one day.
How does a transaction fee affect the profit calculation in stock trading problems?
✗ Incorrect
Each sell transaction reduces profit by the fee amount, so it must be subtracted.
Which data structure or technique is commonly used to solve 'Buy and Sell Stocks with Cooldown'?
✗ Incorrect
Dynamic programming is used to handle cooldown constraints and track states.
Explain how to find the maximum profit when only one buy and one sell are allowed.
Think about the lowest price before the current day.
You got /3 concepts.
Describe how cooldown and transaction fee change the approach to buying and selling stocks.
Consider extra rules that limit when and how profit is made.
You got /3 concepts.
