Your question is 3Sum Coding Problem. 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.
Cloudflare Workers can process collections of numeric request or event attributes at the edge. Given an integer array nums, return every unique triplet of values whose sum is zero.
Implement three_sum(nums). The input is a list of integers. Return a list of lists, where each inner list contains three integers satisfying a + b + c == 0. Do not return duplicate triplets. The order of the triplets and the values within each triplet may be considered arbitrary, but sorting both provides deterministic output.
def three_sum(nums):