feat(content): function signatures + test cases
This commit is contained in:
@@ -8,6 +8,32 @@ categories:
|
||||
patterns:
|
||||
- binary-search
|
||||
|
||||
function_signature: "def range_bitwise_and(left: int, right: int) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { left: 5, right: 7 }
|
||||
expected: 4
|
||||
- input: { left: 0, right: 0 }
|
||||
expected: 0
|
||||
- input: { left: 1, right: 2147483647 }
|
||||
expected: 0
|
||||
hidden:
|
||||
- input: { left: 1, right: 1 }
|
||||
expected: 1
|
||||
- input: { left: 10, right: 10 }
|
||||
expected: 10
|
||||
- input: { left: 0, right: 1 }
|
||||
expected: 0
|
||||
- input: { left: 12, right: 15 }
|
||||
expected: 12
|
||||
- input: { left: 8, right: 10 }
|
||||
expected: 8
|
||||
- input: { left: 1073741824, right: 2147483647 }
|
||||
expected: 1073741824
|
||||
- input: { left: 600000000, right: 600000001 }
|
||||
expected: 600000000
|
||||
|
||||
description: |
|
||||
Given two integers `left` and `right` that represent the range `[left, right]`, return *the bitwise AND of all numbers in this range, inclusive*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user