Python (Simple Dijkstra's algorithm)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def minCost(self, maxTime, edges, passingFees):\n        n, graph = len(passingFees), defaultdict(list)\n\n        for i,j,t in edges:\n            graph[i].append((j,t))\n            graph[j].append((i,t))\n\n        dict1 = {i:float("inf") for i in range(n)}\n\n        dict1[0] = 0\n\n        stack = [(passingFees[0],0,0)]\n\n        while stack:\n            cost,time,node = heapq.heappop(stack)\n\n            if node == n-1:\n                return cost \n\n            for neighbor,t in graph[node]:\n                if dict1[neighbor] > time+t and time+t <= maxTime:\n                    dict1[neighbor] = time+t\n                    heapq.heappush(stack,(cost+passingFees[neighbor],dict1[neighbor],neighbor))\n\n        return -1\n```
['Python3']