feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,24 @@ categories:
patterns:
- two-pointers
function_signature: "def three_sum(nums: list[int]) -> list[list[int]]:"
test_cases:
visible:
- input: { nums: [-1, 0, 1, 2, -1, -4] }
expected: [[-1, -1, 2], [-1, 0, 1]]
- input: { nums: [0, 1, 1] }
expected: []
- input: { nums: [0, 0, 0] }
expected: [[0, 0, 0]]
hidden:
- input: { nums: [-2, 0, 1, 1, 2] }
expected: [[-2, 0, 2], [-2, 1, 1]]
- input: { nums: [1, 2, -2, -1] }
expected: []
- input: { nums: [-4, -2, -2, -2, 0, 1, 2, 2, 2, 3, 3, 4, 4, 6, 6] }
expected: [[-4, -2, 6], [-4, 0, 4], [-4, 1, 3], [-4, 2, 2], [-2, -2, 4], [-2, 0, 2]]
description: |
Given an integer array `nums`, return all the triplets `[nums[i], nums[j], nums[k]]` such that `i != j`, `i != k`, and `j != k`, and `nums[i] + nums[j] + nums[k] == 0`.