feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,24 @@ categories:
patterns:
- two-pointers
function_signature: "def reverse_string(s: list[str]) -> None:"
test_cases:
visible:
- input: { s: ["h", "e", "l", "l", "o"] }
expected: ["o", "l", "l", "e", "h"]
- input: { s: ["H", "a", "n", "n", "a", "h"] }
expected: ["h", "a", "n", "n", "a", "H"]
hidden:
- input: { s: ["a"] }
expected: ["a"]
- input: { s: ["a", "b"] }
expected: ["b", "a"]
- input: { s: ["a", "b", "c"] }
expected: ["c", "b", "a"]
- input: { s: ["1", "2", "3", "4", "5"] }
expected: ["5", "4", "3", "2", "1"]
description: |
Write a function that reverses a string. The input string is given as an array of characters `s`.