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

Day 47 #105

Closed
vaskoz opened this issue Oct 7, 2018 · 0 comments
Closed

Day 47 #105

vaskoz opened this issue Oct 7, 2018 · 0 comments
Assignees

Comments

@vaskoz
Copy link
Owner

vaskoz commented Oct 7, 2018

Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

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 once. You must buy before you can sell it.

For example, given [9, 11, 8, 5, 7, 10], you should return 5, since you could buy the stock at 5 dollars and sell it at 10 dollars.

@vaskoz vaskoz self-assigned this Oct 7, 2018
@vaskoz vaskoz mentioned this issue Oct 7, 2018
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

No branches or pull requests

1 participant