C++ || Dijkstra's Algo || Priority_queue
\nvector<vector<int>> adj[1001];\n    \n    int minCost(int maxTime, vector<vector<int>>& edges, vector<int>& passingFees) {\n        int V=passingFees.size();\
```\nvector<vector<int>> adj[1001];\n    \n    int minCost(int maxTime, vector<vector<int>>& edges, vector<int>& passingFees) {\n        int V=passingFees.size();\n        int E=edges.size();\n        vector<int> cost(V,INT_MAX);\n        vector<int> time(V,INT_MAX);\n      \n        \n        for(auto e: edges){\n            adj[e[0]].push_back({e[1],e[2],passingFees[e[1]]});\n            adj[e[1]].push_back({e[0],e[2],passingFees[e[0]]});\n        }\n        cost[0] = passingFees[0];\n        time[0]=0;\n        int ans=dijkstra(0,V-1,maxTime,cost,time);\n        if (ans==INT_MAX)\n            return -1;\n        return ans;\n    }\n    int dijkstra(int src,int dst,int maxTime,vector<int> &cost,vector<int> &time){\n        \n        \n        priority_queue<vector<int>,vector<vector<int>>, greater<vector<int>>> minh;\n        minh.push({cost[src],time[src],src});\n        \n        while(!minh.empty()){\n            vector<int> temp=minh.top();\n            minh.pop();\n            \n            int c=temp[0];\n            int t=temp[1];\n            int v=temp[2];\n            \n            for(auto X: adj[v]){\n                if(t+X[1] <= maxTime){\n                    if(cost[X[0]] > c + X[2]){\n                        cost[X[0]]=c+X[2];\n                        \n                        time[X[0]]= t+ X[1];\n                        minh.push({cost[X[0]],time[X[0]],X[0]});\n                    }\n                     if(time[X[0]]> t+ X[1]){\n                        time[X[0]]=t+X[1];\n                        minh.push({c+X[2],time[X[0]],X[0]});\n                    }\n                    \n                }\n            }\n            \n        }\n\nreturn cost[dst];\n}\n```\n
['C']