-
-
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
Adding doctests in stock_span_problem.py #10540
base: master
Are you sure you want to change the base?
Adding doctests in stock_span_problem.py #10540
Conversation
for more information, see https://pre-commit.ci
Calculate the span values for a given list of stock prices. | ||
Args: | ||
price (list): List of stock prices. | ||
s (list): List to store the span values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you forcing to caller to allocate this memory? Why not do this in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AasheeshLikePanner didn't write the code in that way. The code was already like that back when it was first contributed to the repo. The code had the caller allocate the memory because it was directly copied (and thus plagiarized) from the GeeksForGeeks article you linked a few hours ago.
…kAndSpan_Doctests # Conflicts: # data_structures/stacks/stock_span_problem.py
for more information, see https://pre-commit.ci
Co-authored-by: Christian Clauss <[email protected]>
…kAndSpan_Doctests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Christian Clauss <[email protected]>
…kAndSpan_Doctests # Conflicts: # data_structures/stacks/stock_span_problem.py
Describe your change:
Adding doctests in stock_span_problem.py
Checklist:
Improve our test coverage #9943