👍👍Amazing✅✅ six-liner solution
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:\n    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:\n        ans = []\n\n        for i in range(len(nums)-1):\n            len_prefix = len(set(nums[:i+1]))\n            len_suffix = len(set(nums[i+1:]))\n            ans.append(len_prefix-len_suffix)\n\n        ans.append(len(set(nums)))\n        return ans\n```
['Python3']