Algorithm · C3.ai · Medium
You are given an array of integers nums. Find every triplet of values [nums[i], nums[j], nums[k]] taken from three different indices (i, j and k all distinct) whose sum equals 0. Return all such triplets. Each distinct triplet of values may appear only once in the result, so the output must contain no repeated triplets. Examples Example 1 Example 2