feat(content): function signatures + test cases

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

View File

@@ -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`.