[Python3] | Dijkstra+Memoization
Solution -  We use Dijkstra algo to find shortest distance from end node to all other nodes. Then we dfs from node 1 and traverse to its neighbours by applying 
Solution -  We use Dijkstra algo to find shortest distance from end node to all other nodes. Then we dfs from node 1 and traverse to its neighbours by applying condition dist[src]>dist[neigh] and when we reach node=n we return 1 means we have found 1 path and we will keep memorizing the result in intermediate process.\n```\nfrom queue import PriorityQueue\nclass Solution:\n    def countRestrictedPaths(self, n: int, edges: List[List[int]]) -> int:\n        adj=collections.defaultdict(list)\n        self.dp=[-1 for i in range(n+1)]\n        self.ans=0\n        for i in range(len(edges)):\n            adj[edges[i][0]].append([edges[i][1],edges[i][2]])\n            adj[edges[i][1]].append([edges[i][0],edges[i][2]])\n        pq,mod=PriorityQueue(),10**9+7\n        dist=[float(\'inf\') for i in range(n+1)]\n        dist[n]=0\n        pq.put([0,n])\n        while not pq.empty():\n            ele=pq.get(0)\n            for it in adj[ele[1]]:\n                if dist[it[0]]>dist[ele[1]]+it[1]:\n                    dist[it[0]]=dist[ele[1]]+it[1]\n                    pq.put([dist[it[0]],it[0]])\n        def dfs(node):\n            ans=0\n            if node==n:\n                return 1\n            if self.dp[node]!=-1:\n                return self.dp[node]\n            for it in adj[node]:\n                if dist[node]>dist[it[0]]:\n                    ans+=dfs(it[0])\n            self.dp[node]=ans\n            return self.dp[node]\n        return dfs(1)%mod\n                    \n```
[]