You are given a nums of length n.
The distinct difference array of nums is an array diff of length n where each element diff[i] is equal to the number of distinct elements in the prefix from index i minus the number of distinct elements in the suffix from index i n
Return the array diff.
Note: The prefix includes the element at index
i, whereas the suffix does not. Wheniis equal ton, the suffix is empty and contains distinct elements.
Constraints:
n nums.length
nums[i]
You are given a nums of length n.
The distinct difference array of nums is an array diff of length n where each element diff[i] is equal to the number of distinct elements in the prefix from index i minus the number of distinct elements in the suffix from index i n
Return the array diff.
Note: The prefix includes the element at index
i, whereas the suffix does not. Wheniis equal ton, the suffix is empty and contains distinct elements.
Constraints:
n nums.length
nums[i]