feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,26 @@ categories:
|
||||
patterns:
|
||||
- prefix-sum
|
||||
|
||||
function_signature: "def unique_occurrences(arr: list[int]) -> bool:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { arr: [1, 2, 2, 1, 1, 3] }
|
||||
expected: true
|
||||
- input: { arr: [1, 2] }
|
||||
expected: false
|
||||
- input: { arr: [-3, 0, 1, -3, 1, 1, 1, -3, 10, 0] }
|
||||
expected: true
|
||||
hidden:
|
||||
- input: { arr: [1] }
|
||||
expected: true
|
||||
- input: { arr: [1, 1, 1] }
|
||||
expected: true
|
||||
- input: { arr: [1, 1, 2, 2] }
|
||||
expected: false
|
||||
- input: { arr: [1, 2, 3] }
|
||||
expected: false
|
||||
|
||||
description: |
|
||||
Given an array of integers `arr`, return `true` *if the number of occurrences of each value in the array is **unique***, or `false` *otherwise*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user