-
Notifications
You must be signed in to change notification settings - Fork 19.9k
[FEATURE REQUEST] Add 4-Sum Problem #5786
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
Comments
@nishchalgv1 I would like to work on this issue, could u assign me? |
we can solve this by fixing 2 values then using 2 pointers to get other 2 values whose total sum equals to given value and return it i would like to solve this,please assign it under hacktoberfest tag |
/assign |
@nishchalgv1 I want to contribute in it can i?? |
/assign |
1 similar comment
/assign |
Hi, I'd like to work on this issue. Could you please assign it to me? |
/assign |
We do not add Leetcode problems |
What would you like to Propose?
I would like to propose adding an implementation of the 4-Sum Problem under the https://github.com/TheAlgorithms/Java/tree/master/src/test/java/com/thealgorithms/misc section of the repository.
Issue details
Problem Statement:
Given an array of N integers, your task is to find unique quads that add up to give a target value. In short, you need to return an array of all the unique quadruplets [arr[a], arr[b], arr[c], arr[d]] such that their sum is equal to a given target.
Example 1:
Input Format:
arr[] = [1,0,-1,0,-2,2], target = 0
Result:
[[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
Explanation:
We have to find unique quadruplets from the array such that the sum of those elements is equal to the target sum given that is 0. The result obtained is such that the sum of the quadruplets yields 0.
Example 2:
Input Format:
arr[] = [4,3,3,4,4,2,1,2,1,1], target = 9
Result:
[[1,1,3,4],[1,2,2,4],[1,2,3,3]]
Explanation:
The sum of all the quadruplets is equal to the target i.e. 9.
Additional Information
No response
The text was updated successfully, but these errors were encountered: