Several bug fixes.

This commit is contained in:
krahets
2023-10-29 00:09:54 +08:00
parent c37f0981f0
commit db5d1d21f3
9 changed files with 14 additions and 17 deletions

View File

@ -9,7 +9,7 @@ import utils
/* k */
func topKHeap(nums: [Int], k: Int) -> [Int] {
// k
// k
var heap = Heap(nums.prefix(k))
// k+1 k
for i in stride(from: k, to: nums.count, by: 1) {