[FEATURE REQUEST] Add 4-Sum Problem
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
@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
/assign
Hi, I'd like to work on this issue. Could you please assign it to me?
/assign
We do not add Leetcode problems