feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 72f7833c6c
commit a1a4eeaed7
134 changed files with 2075 additions and 0 deletions

View File

@@ -8,6 +8,26 @@ categories:
patterns:
- linkedlist-reversal
function_signature: "def reverse_between(head: ListNode, left: int, right: int) -> ListNode:"
test_cases:
visible:
- input: { head: [1, 2, 3, 4, 5], left: 2, right: 4 }
expected: [1, 4, 3, 2, 5]
- input: { head: [5], left: 1, right: 1 }
expected: [5]
hidden:
- input: { head: [1, 2, 3], left: 1, right: 3 }
expected: [3, 2, 1]
- input: { head: [1, 2, 3], left: 1, right: 2 }
expected: [2, 1, 3]
- input: { head: [1, 2, 3], left: 2, right: 3 }
expected: [1, 3, 2]
- input: { head: [1, 2], left: 1, right: 2 }
expected: [2, 1]
- input: { head: [1, 2, 3, 4, 5], left: 1, right: 5 }
expected: [5, 4, 3, 2, 1]
description: |
Given the `head` of a singly linked list and two integers `left` and `right` where `left <= right`, reverse the nodes of the list from position `left` to position `right`, and return *the reversed list*.