feat(content): function signatures + test cases

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

View File

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