feat(content): function signatures + test cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user