feat(content): more test cases

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

View File

@@ -9,6 +9,22 @@ categories:
patterns:
- two-pointers
function_signature: "def add_two_numbers(l1: ListNode | None, l2: ListNode | None) -> ListNode | None:"
test_cases:
visible:
- input: { l1: [2, 4, 3], l2: [5, 6, 4] }
expected: [7, 0, 8]
- input: { l1: [0], l2: [0] }
expected: [0]
- input: { l1: [9, 9, 9, 9, 9, 9, 9], l2: [9, 9, 9, 9] }
expected: [8, 9, 9, 9, 0, 0, 0, 1]
hidden:
- input: { l1: [1], l2: [9, 9] }
expected: [0, 0, 1]
- input: { l1: [5], l2: [5] }
expected: [0, 1]
description: |
You are given two **non-empty** linked lists representing two non-negative integers. The digits are stored in **reverse order**, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.