Go Dijkstra with Heap
\nimport "container/heap"\n\ntype Distance struct {\n    W int\n    V int\n}\n\ntype DistanceHeap []Distance\n\nfunc (h DistanceHeap) Len() int { return len(h) 
```\nimport "container/heap"\n\ntype Distance struct {\n    W int\n    V int\n}\n\ntype DistanceHeap []Distance\n\nfunc (h DistanceHeap) Len() int { return len(h) }\nfunc (h DistanceHeap) Less(i, j int) bool { return h[i].W < h[j].W }\nfunc (h DistanceHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *DistanceHeap) Push(x interface{}) {\n    *h = append(*h, x.(Distance))\n}\n\nfunc (h *DistanceHeap) Pop() interface{} {\n    value := (*h)[len(*h)-1]\n    *h = (*h)[:len(*h)-1]\n    return value\n}\n\nfunc networkDelayTime(times [][]int, N int, K int) int {\n    graph := map[int][]Distance{}\n    \n    for _, time := range times {\n        u, v, w := time[0], time[1], time[2]\n        graph[u] = append(graph[u], Distance{w, v})\n    }\n    \n    q := &DistanceHeap{\n        Distance{0, K},\n    }\n    \n    arrivalTime := map[int]int{}\n    \n    for q.Len() > 0 {\n        d := heap.Pop(q).(Distance)\n        \n        if _, ok := arrivalTime[d.V]; ok {\n            continue\n        }\n        \n        arrivalTime[d.V] = d.W\n        \n        for _, next := range graph[d.V] {\n            next.W += d.W\n            heap.Push(q, next)\n        }\n    }\n    \n    if len(arrivalTime) < N {\n        return -1\n    }\n    \n    maxTime := 0\n    for _, v := range arrivalTime {\n        if v > maxTime {\n            maxTime = v\n        }\n    }\n    \n    return maxTime\n}\n```
['Go']