-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
Bug Report for https://neetcode.io/problems/buy-and-sell-crypto
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
as shown on the description
Returning Negative Profit
If prices only decrease, the maximum profit is 0 (don't trade), not a negative number. Always ensure the result is at least 0.
Unless I understanding it wrong if we have as input prices=[3,4,1] since prices only decrease expected output should be 0, not 1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels