Golang using container/heap
\npackage main\n\nimport (\n\t"container/heap"\n)\n\nfunc lastStoneWeight(stones []int) int {\n\tpq := IntHeap(stones)\n\theap.Init(&pq)\n\tfor pq.Len() > 1 {\n
```\npackage main\n\nimport (\n\t"container/heap"\n)\n\nfunc lastStoneWeight(stones []int) int {\n\tpq := IntHeap(stones)\n\theap.Init(&pq)\n\tfor pq.Len() > 1 {\n\t\theap.Push(&pq, heap.Pop(&pq).(int)-heap.Pop(&pq).(int))\n\n\t}\n\treturn heap.Pop(&pq).(int)\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int           { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice\'s length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n```
['Heap (Priority Queue)', 'Go']