feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,26 @@ categories:
|
||||
patterns:
|
||||
- prefix-sum
|
||||
|
||||
function_signature: "def odd_cells(m: int, n: int, indices: list[list[int]]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { m: 2, n: 3, indices: [[0, 1], [1, 1]] }
|
||||
expected: 6
|
||||
- input: { m: 2, n: 2, indices: [[1, 1], [0, 0]] }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { m: 1, n: 1, indices: [[0, 0]] }
|
||||
expected: 1
|
||||
- input: { m: 3, n: 3, indices: [[0, 0], [1, 1], [2, 2]] }
|
||||
expected: 0
|
||||
- input: { m: 2, n: 2, indices: [[0, 0]] }
|
||||
expected: 3
|
||||
- input: { m: 5, n: 5, indices: [[0, 0], [0, 1], [0, 2]] }
|
||||
expected: 20
|
||||
- input: { m: 3, n: 4, indices: [[0, 0], [1, 1], [0, 1]] }
|
||||
expected: 6
|
||||
|
||||
description: |
|
||||
There is an `m x n` matrix that is initialised to all `0`'s. There is also a 2D array `indices` where each `indices[i] = [r_i, c_i]` represents a **0-indexed location** to perform some increment operations on the matrix.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user