feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,26 @@ categories:
patterns:
- prefix-sum
function_signature: "def least_bricks(wall: list[list[int]]) -> int:"
test_cases:
visible:
- input: { wall: [[1, 2, 2, 1], [3, 1, 2], [1, 3, 2], [2, 4], [3, 1, 2], [1, 3, 1, 1]] }
expected: 2
- input: { wall: [[1], [1], [1]] }
expected: 3
hidden:
- input: { wall: [[1, 1], [1, 1], [1, 1]] }
expected: 0
- input: { wall: [[3, 1], [1, 3], [2, 2]] }
expected: 1
- input: { wall: [[5]] }
expected: 1
- input: { wall: [[1, 1, 1, 1], [2, 2], [1, 3], [4]] }
expected: 1
- input: { wall: [[2, 2, 2], [2, 2, 2], [2, 2, 2]] }
expected: 0
description: |
There is a rectangular brick wall in front of you with `n` rows of bricks. The i<sup>th</sup> row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.