feat(content): function signatures + test cases
This commit is contained in:
@@ -8,6 +8,28 @@ categories:
|
||||
patterns:
|
||||
- greedy
|
||||
|
||||
function_signature: "def alternate_digit_sum(n: int) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { n: 521 }
|
||||
expected: 4
|
||||
- input: { n: 111 }
|
||||
expected: 1
|
||||
- input: { n: 886996 }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { n: 1 }
|
||||
expected: 1
|
||||
- input: { n: 10 }
|
||||
expected: 1
|
||||
- input: { n: 99 }
|
||||
expected: 0
|
||||
- input: { n: 12345 }
|
||||
expected: 3
|
||||
- input: { n: 54321 }
|
||||
expected: 3
|
||||
|
||||
description: |
|
||||
You are given a positive integer `n`. Each digit of `n` has a sign according to the following rules:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user