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 merge(nums1: list[int], m: int, nums2: list[int], n: int) -> list[int]:"
test_cases:
visible:
- input: { nums1: [1, 2, 3, 0, 0, 0], m: 3, nums2: [2, 5, 6], n: 3 }
expected: [1, 2, 2, 3, 5, 6]
- input: { nums1: [1], m: 1, nums2: [], n: 0 }
expected: [1]
- input: { nums1: [0], m: 0, nums2: [1], n: 1 }
expected: [1]
hidden:
- input: { nums1: [4, 5, 6, 0, 0, 0], m: 3, nums2: [1, 2, 3], n: 3 }
expected: [1, 2, 3, 4, 5, 6]
- input: { nums1: [1, 2, 3, 0, 0, 0], m: 3, nums2: [4, 5, 6], n: 3 }
expected: [1, 2, 3, 4, 5, 6]
- input: { nums1: [2, 0], m: 1, nums2: [1], n: 1 }
expected: [1, 2]
description: |
You are given two integer arrays `nums1` and `nums2`, sorted in **non-decreasing order**, and two integers `m` and `n`, representing the number of elements in `nums1` and `nums2` respectively.