Easy C++ solution Dijkstra's algorithm and DFS
Please upvote if you have got any help from my code. Thank you.
```
typedef pair<int, int> p;
class Solution {
public:
    int mod = 1e9+7;
    int dfs(vector<vector<int>> adj[], vector<int>&dis, int curr, int n, vector<int>&dp) {
        if (curr == n) {
            return dp[curr] = 1;
        }
        if (dp[curr] != -1) {
            return dp[curr];
        }
        int count = 0;
        for (auto neighbour : adj[curr]) {
            if (dis[curr] > dis[neighbour[0]]) {
                if (dp[neighbour[0]] == -1) {
                    dp[neighbour[0]] = dfs(adj, dis, neighbour[0], n, dp);
                }
                count = (count + dp[neighbour[0]])%mod;
            }
        }
        return dp[curr] = count;
    }
    int countRestrictedPaths(int n, vector<vector<int>>& edges) {
        vector<vector<int>> adj[n+1];
        for (vector<int> edge : edges) {
            adj[edge[0]].push_back({edge[1], edge[2]});
            adj[edge[1]].push_back({edge[0], edge[2]});
        }
        priority_queue<p, vector<p>, greater<p>> q;
        vector<int>dis(n+1, INT_MAX);
        dis[n] = 0;
        q.push(make_pair(0, n));
        while (!q.empty()) {
            p current = q.top();
            q.pop();
            for (auto neighbour : adj[current.second]) {
                int edgeWeight = neighbour[1], node = neighbour[0];
                if ((edgeWeight+current.first) < dis[node]) {
                    dis[node] = edgeWeight+current.first;
                    q.push(make_pair(dis[node], node));
                }
            }
        }
        vector<int>dp(n+1, -1);
        return dfs(adj, dis, 1, n, dp);
    }
};
```
***Please upvote if you have got any help from my code. Thank you.***
['C++']