Floyd Warshall Algorithm implementation
\nclass Solution {\npublic:\n    vector<int> countOfPairs(int n, int x, int y){\n        vector<vector<int>>adj(n+1, vector<int>(n+1, 101));\n        for(int i=
```\nclass Solution {\npublic:\n    vector<int> countOfPairs(int n, int x, int y){\n        vector<vector<int>>adj(n+1, vector<int>(n+1, 101));\n        for(int i=1; i<n; i++){\n            adj[i][i+1] = 1;\n            adj[i+1][i] = 1;\n        }\n        adj[x][y] = 1;\n        adj[y][x] = 1;\n        for(int via=1; via<=n; via++){\n            for(int i=1; i<=n; i++){\n                for(int j=1; j<=n; j++){\n                    if(i == j) adj[i][j] = 0;\n                    else adj[i][j] = min(adj[i][j], adj[i][via] + adj[via][j]);\n                }\n            }\n        }\n        vector<int>ans(n);\n        for(int i=1; i<=n; i++){\n            for(int j=i+1; j<=n; j++){\n                ans[adj[i][j]-1]+=2;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']