[Python3] Easy Bellman-Ford solution
dp solution.\n\npython\nclass Solution:\n    def minCost(self, maxTime: int, edges: List[List[int]], passingFees: List[int]) -> int:\n        \'\'\'\n        Ti
dp solution.\n\n```python\nclass Solution:\n    def minCost(self, maxTime: int, edges: List[List[int]], passingFees: List[int]) -> int:\n        \'\'\'\n        Time: O((m+n)* maxtime), where m is length of edges\n        Space: O(n*maxtime)\n        \'\'\'\n        n = len(passingFees)\n        dp = [[math.inf]*(n) for _ in range(maxTime+1)]\n        dp[0][0] = passingFees[0]\n\n        ans = math.inf\n        for k in range(1, maxTime+1):\n            for x, y, time in edges:\n                if k >= time:\n                    # dual direction\n                    dp[k][y] = min(dp[k][y], dp[k-time][x] + passingFees[y])\n                    dp[k][x] = min(dp[k][x], dp[k-time][y] + passingFees[x])\n                \n            ans = min(ans, dp[k][n-1])\n        \n        if ans == math.inf:\n            return -1\n        return ans\n```
['Dynamic Programming', 'Python']