JavaScript Solution - Short, Sweet & Easy to understand
Code
# Code
```javascript []
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var distinctDifferenceArray = function(nums) {
    return nums.map((num, i) => distinctNumbers(nums, 0, i) - distinctNumbers(nums, i + 1, nums.length))
};

let distinctNumbers = function(arr, from, to) {
    return new Set(arr.slice(from, to + 1)).size;
}
```
['JavaScript']