Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gives a solution to the problem of Peaks and Valleys in C++ #2153

Open
theopaid opened this issue Sep 27, 2020 · 0 comments · May be fixed by #2160
Open

Gives a solution to the problem of Peaks and Valleys in C++ #2153

theopaid opened this issue Sep 27, 2020 · 0 comments · May be fixed by #2160

Comments

@theopaid
Copy link

Buying and selling stocks gets optimized for maximum profit.

The key point is we need to consider every peak immediately following a valley to maximize the profit. In case we skip one of the peaks (trying to obtain more profit), we will end up losing the profit over one of the transactions leading to an overall lesser profit. #HacktoberFest

@theopaid theopaid linked a pull request Oct 1, 2020 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant