feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -9,6 +9,22 @@ categories:
patterns:
- linkedlist-reversal
function_signature: "def reverse_list(head: ListNode | None) -> ListNode | None:"
test_cases:
visible:
- input: { head: [1, 2, 3, 4, 5] }
expected: [5, 4, 3, 2, 1]
- input: { head: [1, 2] }
expected: [2, 1]
- input: { head: [] }
expected: []
hidden:
- input: { head: [1] }
expected: [1]
- input: { head: [1, 2, 3] }
expected: [3, 2, 1]
description: |
Given the `head` of a singly linked list, reverse the list, and return *the reversed list*.