Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create Combination_sum.java #488

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

Open
thebharat07 wants to merge 1 commit into codedecks-in:master
base: master
Choose a base branch
Loading
from thebharat07:combination_sum(java)

Conversation

Copy link

@thebharat07 thebharat07 commented Jun 24, 2024

Combination sum solution in java.

Explanation of the solution:

So, here we are asked to return lists of integers whose sum is equal to a given a target.
For that our general idea is to add all the possible numbers less than the target for any number of times to achieve the target and create a list of all the numbers we used.
This is where BACKTRACKING comes into play.
We will recursively send our list which contains the solutions and a list which keeps track of our solution and and integer from where we will iterate through the given values and find the solution.

Combination sum solution in java.
Copy link

welcome bot commented Jun 24, 2024

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@anandfresh anandfresh anandfresh approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /