Given an integer array `nums`, return an array `ans` of the same length where `ans[i]` is the sum of absolute differences between `i` and all other indices `j` such that `nums[j] == nums[i]` (i.e. |i…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.