# what is the time complexity for this codes

• '''
public class Solution {
public List<List<Integer>> fourSum(int[] nums, int target) {
HashMap<Integer, List<List<Integer>>> map = new HashMap<>();
for(int i = 0; i < nums.length; i++){
for(int j = i + 1; j < nums.length; j++){
int sum = nums[i] + nums[j];
if(!map.containsKey(sum)){
map.put(sum, new ArrayList<>());
}
}
}
HashSet<List<Integer>> set = new HashSet<>();
HashSet<Integer> set1 = new HashSet<>();
for(int i = 0; i < nums.length; i++) {
if (set1.contains(nums[i])){
continue;
}else{
}
HashSet<Integer> set2 = new HashSet<>();
for(int j = i + 1; j < nums.length; j++){
if (set2.contains(nums[j])){
continue;
}else{
}
if(map.containsKey(target-nums[i]-nums[j])){
List<List<Integer>> twoSum = map.get(target-nums[i]-nums[j]);
for (List<Integer> list : twoSum) {
if(list.get(0) == i || list.get(1) == j){
continue;
}
if(list.get(0) == j || list.get(1) == i){
continue;
}
List<Integer> l = new ArrayList<>();
Collections.sort(l);
}
}
}
}
List<List<Integer>> res = new ArrayList<>(set);
Collections.sort(res, new Comparator<List<Integer>>(){
public int compare(List<Integer> list1, List<Integer> list2){
if(list1.get(0) == list2.get(0)){
if(list1.get(1) == list2.get(1)){
return list1.get(2) - list2.get(2);
}else{
return list1.get(1) - list2.get(1);
}
}else{
return list1.get(0) - list2.get(0);
}
}
});
return res;
}
}
'''

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.