C# || Solution with LINQ
Code\n\npublic class Solution\n{\n    public int[] DistinctDifferenceArray(int[] nums)\n    {\n        var n = nums.Length;\n        var result = new int[n];\n 
# Code\n```\npublic class Solution\n{\n    public int[] DistinctDifferenceArray(int[] nums)\n    {\n        var n = nums.Length;\n        var result = new int[n];\n        \n        for (var i = 0; i < n; i++)\n            result[i] = nums[..(i + 1)].Distinct().Count() - nums[(i + 1)..].Distinct().Count();\n\n        return result;\n    }\n}\n\n```
['C#']