Google Interview Question

modified Dijkstra's algorithm