NeetCode #142LC-1685MediumArrays & Hashing
← Back to All Problems#142 · #1685 · Sum of Absolute Differences in a Sorted Array(有序数组中差绝对值之和)
📌 Problem Statement & Constraints
Given an array
nums sorted in non-decreasing order, return an array where result[i] is the sum of |nums[i] - nums[j]| over all j. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!