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