-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Added Combination Sum problem #1747
Conversation
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible.). If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
⚡️ Lighthouse Report for the Deploy Preview of this PR 🚀
|
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.
update your code based on suggestions
| id | sidebar_position | title | sidebar_label | description | tags | | ||
|------------------|------------------|------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------| | ||
| combination-sum | 2 | Combination Sum | Combination Sum | Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. | java, problem-solving | | ||
|
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 follow our documentation format and syntax. Also, please read our contribution guidelines carefully.
``` | ||
|
||
## Complexity Analysis | ||
- **Time Complexity**: O(2^t) x O(k), where `t` is the target and `k` is the average length of combinations. |
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.
replace O(2^t) x O(k)
with $O(2^t) \times O(k)$
📥 Pull Request
Description
This PR implements the Combination Sum problem solution, which returns all unique combinations of distinct integers that sum to a given target. The algorithm allows each candidate to be used an unlimited number of times. This implementation includes both a brute-force approach and an optimized backtracking approach.
Fixes # (issue number)
Type of change
Checklist: