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):