MCPcopy Create free account
hub / github.com/DestinationFAANG/Destination-FAANG-Java-Solution / threeSum

Method threeSum

15 3sum/15 3-Sum.java:6–19  ·  view source on GitHub ↗
(int[] nums)

Source from the content-addressed store, hash-verified

4
5class Solution {
6 public List<List<Integer>> threeSum(int[] nums) {
7
8 Arrays.sort(nums);
9 List<List<Integer>> result = new ArrayList<>();
10
11 for (int i = 0; i<nums.length && nums[i] <=0; i++){
12 if (i == 0 || nums[i] != nums[i-1]){
13 twoSum2(nums, i, result);
14 }
15 }
16
17 return result;
18
19 }
20
21 void twoSum2(int[] nums, int i, List<List<Integer>> result){
22 int left = i+1;

Callers

nothing calls this directly

Calls 1

twoSum2Method · 0.95

Tested by

no test coverage detected