Skip to content

Conversation

@DhruvTotala
Copy link

What type of PR is this? (check all applicable)

  • [X ] πŸš€ Added Name
  • [ X] ✨ Feature
  • [ X] 🌟 stared the repo
  • [X ] πŸ› Grammatical Error
  • [X ] πŸ“ Documentation Update
  • [ X] 🚩 Other

Description

nput:

We first ask the user to input the number of days n.
Then, the user provides the stock prices for each day as input.
Logic:

The function maxProfit calculates the maximum profit by iterating through the stock prices.
min_price keeps track of the lowest price seen so far.
max_profit is updated if the difference between the current price and the min_price gives a higher profit.
Output:

The program outputs the maximum possible profit.

Add Link of GitHub Profile

https://github.com/DhruvTotala

@DhruvTotala
Copy link
Author

@keshavsingh4522 please review my code and suggest necessary changes.

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