✅ [Swift] One liner, easy to understand
\nclass Solution {\n    func distinctDifferenceArray(_ nums: [Int]) -> [Int] {\n        nums.enumerated().map { Set(nums[0...$0.offset]).count - Set(nums[($0.of
```\nclass Solution {\n    func distinctDifferenceArray(_ nums: [Int]) -> [Int] {\n        nums.enumerated().map { Set(nums[0...$0.offset]).count - Set(nums[($0.offset + 1)...]).count }\n    }\n}\n```
['Swift']