Floyd-Warshall C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> countOfPairs(int n, int x, int y) {\n        x--;\n        y--;\n        vector<vector<int>>dist(n , vector<int>(n, INT_MAX));\n        for(int i=0; i<n; i++){\n            if(i > 0){\n                dist[i][i-1] = 1;\n                dist[i-1][i] = 1;\n            }\n        }\n        dist[x][y] = 1;\n        dist[y][x] = 1;\n        for(int k=0; k<n; k++){\n            for(int i=0; i<n; i++){\n                for(int j=0; j<n; j++){\n                    if (dist[i][k] == INT_MAX || dist[k][j] == INT_MAX)continue;\n                    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);\n                }\n            }\n        }\n        vector<int>result(n , 0);\n        for(int i=0; i<n; i++){\n            for(int j=i+1; j<n; j++){\n                int d = dist[i][j];\n                if(d <= n){\n                    result[d-1]+=2;\n                }\n            }\n        }\n        return result; \n\n        \n    }\n};\n```
['C++']