feat: progress

This commit is contained in:
2026-05-23 16:12:24 -04:00
parent 2ca8bb4427
commit dc373fecb5
9 changed files with 660 additions and 11 deletions

View File

@@ -6,6 +6,13 @@ import (
func MaxSlidingWindow(nums []int, k int) []int {
h := heap.NewBy(heap.More, nums[:k]...)
result := []int{h.Data[0]}
result := []int{h.Top()}
for i := range nums[k:] {
h.Drop(nums[i])
h.Put(nums[i+k])
result = append(result, h.Top())
}
return result
}