✅C++ easiest solution
\nclass Solution {\npublic:\n    \n    vector<int> distinctDifferenceArray(vector<int>& nums) {\n        unordered_map<int,int>mpsuffix,mpprefix;\n        for(i
```\nclass Solution {\npublic:\n    \n    vector<int> distinctDifferenceArray(vector<int>& nums) {\n        unordered_map<int,int>mpsuffix,mpprefix;\n        for(int i=0;i<nums.size();i++){\n            mpsuffix[nums[i]]++;\n        }\n    vector<int>ans;\n    \n    for(int i=0;i<nums.size();i++){\n        mpprefix[nums[i]]++;\n        mpsuffix[nums[i]]--;\n        \n        if(mpsuffix[nums[i]]<=0) mpsuffix.erase(nums[i]);\n        int bsz=mpprefix.size();\n        int fsz=mpsuffix.size();\n        \n        ans.push_back(bsz-fsz);\n    }\n    \n    return ans;\n\n    }\n};\n```
['C']