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