Easiest || simple Solution || 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> distinctDifferenceArray(vector<int>& nums) {\n        int n = nums.size();\n    vector<int> diff(n);\n\n    for (int i = 0; i < n; i++) {\n        int prefixDistinct = 0;\n        int suffixDistinct = 0;\n\n        vector<bool> prefixSeen(n, false);\n        vector<bool> suffixSeen(n, false);\n\n        for (int j = 0; j <= i; j++) {\n            if (!prefixSeen[nums[j]]) {\n                prefixDistinct++;\n                prefixSeen[nums[j]] = true;\n            }\n        }\n\n        for (int j = n - 1; j > i; j--) {\n            if (!suffixSeen[nums[j]]) {\n                suffixDistinct++;\n                suffixSeen[nums[j]] = true;\n            }\n        }\n\n        diff[i] = prefixDistinct - suffixDistinct;\n    }\n\n    return diff;\n    }\n};\n```
['C++']