🚀✅ Python Easy Dijkstra 🔥
python\ndef countOfPairs(self, n: int, x: int, y: int) -> List[int]:\n    adj = defaultdict(list)  # adjacency list\n    for i in range(1, n):\n        adj[i].a
```python\ndef countOfPairs(self, n: int, x: int, y: int) -> List[int]:\n    adj = defaultdict(list)  # adjacency list\n    for i in range(1, n):\n        adj[i].append((1, i+1))\n        adj[i+1].append((1, i))\n    adj[x].append((1, y))\n    adj[y].append((1, x))\n\n    vis = [[float(\'inf\')]*n for _ in range(n)]  # min dist for each node pair\n    for i in range(n):\n        q = [(0, i+1)]\n        while q:\n            d, s = heappop(q)\n            if vis[i][s-1] > d:\n                vis[i][s-1] = d\n                for nd, nb in graph[s]:\n                    heappush(q, (d+nd, nb))\n    res = [0]*(n+1)\n    for i in range(n):\n        for j in range(n):\n            res[vis[i][j]] += 1\n    return res[1:]\n```\n#### \uD83C\uDFAF Please upvote if you like the solution \uD83D\uDC4D
['Graph', 'Python', 'Python3']