Algorithm · Visa · Medium
You are given an integer array nums containing n values. Determine whether the array contains three elements a, b, and c such that a + b + c = 0. Return every unique triplet of values from nums whose sum equals zero. A triplet is considered duplicate if it contains the same three values, regardless of their order. You may return the triplets in any order. Function Signature Examples Example 1 Explanation: -1 + -1 + 2 = 0 and -1 + 0 + 1 = 0. The array contains -1 twice, which…
Checking your access…