MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / Push

Method Push

go/1046-last-stone-weight.go:6–6  ·  view source on GitHub ↗
(x interface{})

Source from the content-addressed store, hash-verified

4func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
5func (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
6func (h *IntHeap) Push(x interface{}) {*h = append(*h, x.(int))}
7func (h *IntHeap) Pop() interface{} {
8 old := *h
9 n := len(old)

Callers 1

lastStoneWeightFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected