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

Team B Application #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JustinTheGreat
Copy link

CS Games 2023 Team B Application

PLEASE FILL IN THE FOLLOWING!

Full Name

Justin Zheng

UWindsor Email

[email protected]

Application Form

Briefly explain how your solution works and how to run it

In my code, I defined the whole thing as a function. First, I check for the cases where there is less than 2 days/stock prices or if the max price is after the min price. Then if the scenario is very complicated, I use a nested for loop to go over the whole array to compare from right number to left number and by subtracting the right by left numbers. From this we compare the values and find the max value possible from all the possible profit values and return the highest value.

In my code, I defined the whole thing as a function. First, I check for the cases where there is less than 2 days/stock prices or if the max price is after the min price. Then if the scenario is very complicated, I use a nested for loop to go over the whole array to compare from right number to left number and by subtracting the right by left numbers. From this we compare the values and find the max value possible from all the possible profit values and return the highest value.
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 this pull request may close these issues.

1 participant