C# | Easy | Using HashSet
IntuitionCreate prefixSet and suffixSet of current element and get the differenceApproach
Iterate through nums till the end of array
Add all distinct elements f
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Create prefixSet and suffixSet of current element and get the difference

# Approach
<!-- Describe your approach to solving the problem. -->
1. Iterate through nums till the end of array
2. Add all distinct elements from 0 till i to prefixSet
3. Add all distinct elements from nums.Length -1 till i to suffixSet
4. Add different of distinct elements in result array
# Complexity
- Time complexity: $$O(n^2)$$ 
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

# Code
```csharp []
public class Solution {
    public int[] DistinctDifferenceArray(int[] nums) {
        
        // result array
        int[] result = new int[nums.Length];

        // Iterate through nums till the end of array
        for (int i = 0; i < nums.Length; i++)
        {
            // Add all distict elements from 0 till i to prefixSet
            HashSet<int> prefixSet = new HashSet<int>();
            for (int j = 0; j <= i; j++)
            {
                prefixSet.Add(nums[j]);
            }

            // Add all distict elements from nums.Length -1 till i to suffixSet
            HashSet<int> suffixSet = new HashSet<int>();
            for ( int j = nums.Length - 1; j > i; j--)
            {
                suffixSet.Add(nums[j]);
            }

            // add different of distinct elements in result array
            result[i] = prefixSet.Count - suffixSet.Count;
            
        }     

        return result;
    }
}
```
['Array', 'Hash Table', 'C#']