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,32 @@ categories:
patterns:
- monotonic-stack
function_signature: "def largest_rectangle_area(heights: list[int]) -> int:"
test_cases:
visible:
- input: { heights: [2, 1, 5, 6, 2, 3] }
expected: 10
- input: { heights: [2, 4] }
expected: 4
- input: { heights: [1, 1] }
expected: 2
hidden:
- input: { heights: [1] }
expected: 1
- input: { heights: [0] }
expected: 0
- input: { heights: [2, 1, 2] }
expected: 3
- input: { heights: [1, 2, 3, 4, 5] }
expected: 9
- input: { heights: [5, 4, 3, 2, 1] }
expected: 9
- input: { heights: [3, 6, 5, 7, 4, 8, 1, 0] }
expected: 20
- input: { heights: [4, 2, 0, 3, 2, 5] }
expected: 6
description: |
Given an array of integers `heights` representing the histogram's bar height where the width of each bar is `1`, return *the area of the largest rectangle in the histogram*.