Easy to understand
Java []\nclass Solution {\n    public int[] countOfPairs(int n, int x, int y) {\n        int[] ans = new int[n];\n        \n        for (int i = 1; i <= n; i++)
```Java []\nclass Solution {\n    public int[] countOfPairs(int n, int x, int y) {\n        int[] ans = new int[n];\n        \n        for (int i = 1; i <= n; i++) {\n            for (int j = i + 1; j <= n; j++) {\n                int min = Math.min(Math.abs(x - i) + Math.abs(y - j) + 1, Math.min(Math.abs(y - i) + Math.abs(x - j) + 1, Math.abs(i - j)));\n                ans[min - 1]+=2;\n            }\n        }\n        \n        return ans;\n    }\n}\n```\n```python []\nclass Solution:\n    def countOfPairs(self, n, x, y):\n        ans = [0] * n\n\n        for i in range(1, n + 1):\n            for j in range(i + 1, n + 1):\n                minimum = min(abs(x - i) + abs(y - j) + 1, min(abs(y - i) + abs(x - j) + 1, abs(i - j)))\n                ans[minimum - 1] += 2\n\n        return ans\n```\n```C++ []\nclass Solution {\npublic:\n    vector<int> countOfPairs(int n, int x, int y) {\n        vector<int> ans(n, 0);\n\n        for (int i = 1; i <= n; i++) {\n            for (int j = i + 1; j <= n; j++) {\n                int minimum = min(abs(x - i) + abs(y - j) + 1,\n                                       min(abs(y - i) + abs(x - j) + 1, abs(i - j)));\n                ans[minimum - 1] += 2;\n            }\n        }\n\n        return ans;\n    }\n};\n```
['Python', 'C++', 'Java']