feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,26 @@ categories:
patterns:
- two-pointers
function_signature: "def add_negabinary(arr1: list[int], arr2: list[int]) -> list[int]:"
test_cases:
visible:
- input: { arr1: [1, 1, 1, 1, 1], arr2: [1, 0, 1] }
expected: [1, 0, 0, 0, 0]
- input: { arr1: [0], arr2: [0] }
expected: [0]
- input: { arr1: [0], arr2: [1] }
expected: [1]
hidden:
- input: { arr1: [1], arr2: [1] }
expected: [1, 1, 0]
- input: { arr1: [1, 0], arr2: [1, 0] }
expected: [1, 1, 0, 0]
- input: { arr1: [1, 1], arr2: [1, 1] }
expected: [0]
- input: { arr1: [1, 0, 1], arr2: [1, 0, 1] }
expected: [1, 1, 1, 1, 0]
description: |
Given two numbers `arr1` and `arr2` in base **-2** (negabinary), return the result of adding them together.