Easy sol^n
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        vector<int>ans(n,0);\n         if(x==y)\n         {\n             for(int i=1;i<=n;i++)\n             {\n                for(int j=1;j<=n;j++)\n                {\n                    if(i!=j)\n                    {\n                      ans[abs(i-j)-1]++;\n                    }\n                }\n             }\n             return ans;\n         }\n         else\n         {\n            int a=min(x,y);\n            int b=max(x,y);\n               x=a;\n               y=b;\n             for(int i=1;i<=n;i++)\n             {\n                for(int j=1;j<=n;j++)\n                {\n                    if(i!=j)\n                    {\n                      if(i<=min(x,y)&&j<=min(x,y))\n                      {\n                        ans[abs(i-j)-1]++; \n                      }\n                      else if(i>=max(x,y)&&j>=max(x,y))\n                      {\n                        ans[abs(i-j)-1]++;\n                      }\n                      else\n                      {\n                        if(i-j<0)\n                        {\n                         int value=(j-i);\n                         int value1=abs(i-x);\n                         value1++;\n                         value1=value1+abs(y-j);\n                         value=min(value,value1);\n                          ans[value-1]++;\n                        }\n                        else\n                        {\n                           int value=(i-j);\n                           int value1=abs(i-y);\n                           value1++;\n                           value1=value1+abs(x-j);\n                           value=min(value,value1);\n                          ans[value-1]++;\n                        }\n                      }\n                    }\n                }\n             }\n             return ans;\n         }  \n\n    }\n};\n```
['C++']