-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
Create combination_sum.py #7403
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
Co-authored-by: Christian Clauss <[email protected]>
backtracking/combination_sum.py
Outdated
>>> combination_sum([2, 3, 6, 7], 7) | ||
[[2, 2, 3], [7]] | ||
>>> combination_sum([-8, 2.3, 0], 1) | ||
Put the right answer here |
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.
Please fix this line so that the tests are green ✅
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.
Thanks, I didn't notice. I have added constraints instead.
backtracking/combination_sum.py
Outdated
@@ -37,8 +44,6 @@ def combination_sum(candidates: list, target: int) -> list: | |||
[[2, 2, 2, 2], [2, 3, 3], [3, 5]] | |||
>>> combination_sum([2, 3, 6, 7], 7) | |||
[[2, 2, 3], [7]] | |||
>>> combination_sum([-8, 2.3, 0], 1) |
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 remove this test?
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.
It was breaking the constraints. I have added again.
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.
Rock and roll!
This reverts commit b90ec30.
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.