Python3 Solution
\n\nclass Solution:\n    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:\n        n=len(nums)\n        left=0\n        right=n-1\n        ans=[
\n```\nclass Solution:\n    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:\n        n=len(nums)\n        left=0\n        right=n-1\n        ans=[]\n        while left<n:\n            ans.append(len(set(nums[0:left+1]))-len(set(nums[left+1:right+1])))\n            right+=1\n            left+=1\n\n        return ans    \n```
['Python', 'Python3']