Easy to understand Python solution
Code\n\nclass Solution:\n    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:\n        ans = []\n        for i in range(len(nums)):\n           
# Code\n```\nclass Solution:\n    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:\n        ans = []\n        for i in range(len(nums)):\n            ans.append(len(set(nums[:i+1]))-len(set(nums[i+1:])))\n        return ans\n```
['Python3']