The problem statement from leetcode says:
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Fin
public ArrayList> fourSum(int[] num, int target) {
Arrays.sort(num);
ArrayList> res=new ArrayList>();
int i=0;
while(i t=new ArrayList();
t.add(num[i]);
t.add(num[j]);
t.add(num[left]);
t.add(num[right]);
res.add(t);
left++;
right--;
while(lefttarget-num[i]-num[j])
right--;
else
left++;
}
j++;
while(j