easy solution
Intuitiontake the length of set of left side and length of set of right side and subtract themApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
take the length of set of left side and length of set of right side and subtract them


# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def distinctDifferenceArray(self, nums: List[int]) -> List[int]:
        #left, right = 0, len(nums)
        res = [0] * len(nums)
        for i in range(len(nums)):
            left = len(set(nums[:i + 1]))
            right = len(set(nums[i + 1:]))
            print(left, right, i)
            res[i] = left - right
        return res


```
['Python3']