Three Sum — JavaScript medium interview problem
Given an integer array `nums`, return all unique triplets `[nums[i], nums[j], nums[k]]` such that `i != j != k` and `nums[i] + nums[j] + nums[k] === 0`. The solution set must not contain duplicate triplets. Order of triplets / values inside a triplet may vary — the judge compares as multisets.
Tags: two-pointers, sorting
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.