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

@@ -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: