-
-
Notifications
You must be signed in to change notification settings - Fork 49.9k
Removed unused variable m. #2202
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
Conversation
dynamic_programming/coin_change.py
Outdated
| def dp_count(S, n): | ||
| """ | ||
| >>> dp_count([1, 2, 3], 3, 4) |
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.
| def dp_count(S, n): | |
| """ | |
| >>> dp_count([1, 2, 3], 3, 4) | |
| from typing import List, Optional | |
| def coin_change(make_change_for: int, coin_types: List[int] = None) -> int: | |
| """ | |
| >>> coin_change(4, [1, 2, 3]) |
If the doctests are not modified to match the function then our automated tests will fail.
While we are here, let's modify the function to use self-documenting names for function and variables. Let's also add Python type hints.
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.
Before line 24 we could give coin_types a default value by adding the line coin_types = coin_types or (1, 5, 10, 25, 100)
This would allow a call such as coin_change(17).
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.
Updated the doctests.
Before line 24 we could give coin_types a default value by adding the line coin_types = coin_types or (1, 5, 10, 25, 100)
This would allow a call such as coin_change(17).
Didn't get this point can you please explain.
|
Please add a test where |
Added condition for negative values and the doctest. |
|
Hey @himadriganguly, TravisCI finished with status TravisBuddy Request Identifier: 373c2f10-c6db-11ea-aa06-e17841301e13 |
|
Hey @himadriganguly, TravisCI finished with status TravisBuddy Request Identifier: 20a30200-c6dc-11ea-aa06-e17841301e13 |
ruppysuppy
left a comment
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.
The doctest is failing
Co-authored-by: Tapajyoti Bose <44058757+ruppysuppy@users.noreply.github.com>
Travis tests have failedHey @himadriganguly, TravisBuddy Request Identifier: e2aef8b0-ca9f-11ea-84bb-258f0278865c |
|
The doctests are failing, make sure that all the doctests are successful |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Please reopen this issue once you commit the changes requested or make improvements on the code. Thank you for your contributions. |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.