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,28 @@ categories:
patterns:
- two-pointers
function_signature: "def add_to_array_form(num: list[int], k: int) -> list[int]:"
test_cases:
visible:
- input: { num: [1, 2, 0, 0], k: 34 }
expected: [1, 2, 3, 4]
- input: { num: [2, 7, 4], k: 181 }
expected: [4, 5, 5]
- input: { num: [2, 1, 5], k: 806 }
expected: [1, 0, 2, 1]
hidden:
- input: { num: [0], k: 1 }
expected: [1]
- input: { num: [9, 9, 9], k: 1 }
expected: [1, 0, 0, 0]
- input: { num: [1], k: 99 }
expected: [1, 0, 0]
- input: { num: [0], k: 10000 }
expected: [1, 0, 0, 0, 0]
- input: { num: [5, 5, 5], k: 555 }
expected: [1, 1, 1, 0]
description: |
The **array-form** of an integer `num` is an array representing its digits in left to right order.