Python Simple Dijkstra Beats ~90%
Time - O(N + ELogN) -Standard Time complexity of Dijkstra\'s algorithm\n\nSpace - O(N + E) - for adjacency list and maintaining Heap.\n\n\nclass Solution:\n    
**Time - O(N + ELogN)** -Standard Time complexity of [Dijkstra\'s algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Running_time)\n\n**Space - O(N + E)** - for adjacency list and maintaining Heap.\n\n```\nclass Solution:\n    def networkDelayTime(self, times: List[List[int]], n: int, k: int) -> int:        \n        adj_list = defaultdict(list)\n        \n        for x,y,w in times:\n            adj_list[x].append((w, y))\n        \n        visited=set()\n        heap = [(0, k)]\n        while heap:\n            travel_time, node = heapq.heappop(heap)\n            visited.add(node)\n            \n            if len(visited)==n:\n                return travel_time\n            \n            for time, adjacent_node in adj_list[node]:\n                if adjacent_node not in visited:\n                    heapq.heappush(heap, (travel_time+time, adjacent_node))\n                \n        return -1\n```\n\n--- \n\n***Please upvote if you find it useful***
['Python', 'Python3']