Your question is Find Unique Triplets That Sum to Zero. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an integer array nums, return all the unique triplets [nums[i], nums[j], nums[k]] such that i, j, and k are distinct indices and nums[i] + nums[j] + nums[k] == 0.
The solution must avoid duplicate triplets in the output.
def three_sum(nums):