easy java solution - BATTU VAMSI
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# 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
```java []
class Solution {
    public int[] distinctDifferenceArray(int[] nums) {

        //List<Integer> result = new ArrayList<>();

        int[] arr = new int[nums.length];

        for(int i=0;i<nums.length;i++)
        {
            Set<Integer> left = new LinkedHashSet<>();
            Set<Integer> right = new LinkedHashSet<>();


            for(int j=0;j<nums.length;j++)
            {
                if(i>=j)
                {
                    left.add(nums[j]);

                }
                else{
                    right.add(nums[j]);
                }
            }

         //System.out.println("left : "+left);
         //System.out.println("right : "+right);




            //result.add(left.size()-right.size());

            arr[i]=left.size()-right.size();
        }


    //  int[] arr = new int[result.size()];

    //   for(int i = 0;i<result.size();i++)
    //   {
    //        arr[i]= result.get(i);
    //   }

      return arr;
        
    }
}
```
['Java']