Rippling Interview Question

to implement a standard Dijkstra Algorithm