feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -11,6 +11,30 @@ patterns:
- heap
- binary-search
function_signature: "def find_kth_largest(nums: list[int], k: int) -> int:"
test_cases:
visible:
- input: { nums: [3, 2, 1, 5, 6, 4], k: 2 }
expected: 5
- input: { nums: [3, 2, 3, 1, 2, 4, 5, 5, 6], k: 4 }
expected: 4
- input: { nums: [1], k: 1 }
expected: 1
hidden:
- input: { nums: [7, 7, 7, 7], k: 2 }
expected: 7
- input: { nums: [1, 2, 3, 4, 5], k: 5 }
expected: 1
- input: { nums: [1, 2, 3, 4, 5], k: 1 }
expected: 5
- input: { nums: [-1, -2, -3, -4], k: 1 }
expected: -1
- input: { nums: [5, 2, 4, 1, 3, 6, 0], k: 3 }
expected: 4
- input: { nums: [99, 99], k: 1 }
expected: 99
description: |
Given an integer array `nums` and an integer `k`, return *the* `k`<sup>th</sup> *largest element in the array*.