3 SUM

Problems statement Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Sample Test Cases Problem Solution We Solve this question by fixing the first element and then finding the other two using two pointer algorithm. So first we sort the array in ascending …

3 SUM Read More »