GitHub - stormlex4all/StockMax · GitHub
Skip to content

stormlex4all/StockMax

Folders and files

Repository files navigation

StockMax

Your algorithms have become so good at predicting the market that you now know what the share price of a company say AAC will be for the next number of days.

Each day, you can either buy one share of AAC, sell any number of shares of AAC that you own, or not make any transaction at all. What is the maximum profit you can obtain with an optimum trading strategy? Write a method to calculate this as shown;

Example Prices = [1,2]; Buy one share day one, and sell it day two for a profit of 1. Return 1. Prices = [2,1]; No profit can be made so you do not buy or sell stock those days. Return 0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages