Simple JAVA Solution for beginners.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] distinctDifferenceArray(int[] nums) {\n        int diff[] = new int[nums.length];\n        for(int i = 0; i < nums.length; i++) {\n            Set<Integer> prefixSet = new HashSet();\n            Set<Integer> suffixSet = new HashSet();\n            for(int j = 0; j < nums.length; j++) {\n                if(j <= i) {\n                    prefixSet.add(nums[j]);\n                }\n                if(j > i) {\n                    suffixSet.add(nums[j]);\n                }\n            }\n            diff[i] = prefixSet.size() - suffixSet.size();\n        }\n        return diff;\n    }\n}\n```
['Array', 'Hash Table', 'Java']