feat: stuff
This commit is contained in:
11
pkg/questions/maximum_sliding_window/main.go
Normal file
11
pkg/questions/maximum_sliding_window/main.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package maximum_sliding_window
|
||||
|
||||
import (
|
||||
"git.maximhutz.com/practice/pkg/tools/heap"
|
||||
)
|
||||
|
||||
func MaxSlidingWindow(nums []int, k int) []int {
|
||||
h := heap.NewBy(heap.More, nums[:k]...)
|
||||
result := []int{h.Data[0]}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user