feat(content): function signatures + test cases
This commit is contained in:
@@ -10,6 +10,30 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def subarray_bitwise_ors(arr: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { arr: [0] }
|
||||
expected: 1
|
||||
- input: { arr: [1, 1, 2] }
|
||||
expected: 3
|
||||
- input: { arr: [1, 2, 4] }
|
||||
expected: 6
|
||||
hidden:
|
||||
- input: { arr: [1] }
|
||||
expected: 1
|
||||
- input: { arr: [0, 0, 0] }
|
||||
expected: 1
|
||||
- input: { arr: [1, 2, 3, 4, 5] }
|
||||
expected: 7
|
||||
- input: { arr: [7, 7, 7] }
|
||||
expected: 1
|
||||
- input: { arr: [1, 3, 5, 7] }
|
||||
expected: 4
|
||||
- input: { arr: [8, 4, 2, 1] }
|
||||
expected: 10
|
||||
|
||||
description: |
|
||||
Given an integer array `arr`, return *the number of distinct bitwise ORs of all the non-empty subarrays of* `arr`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user