Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

int low = 0; int high = nums.length - 1; int mid = (low + high) / 2; int count = 0; for (int i = 0; i < mid; i++) count += nums[mid] - nums[i]; for (int i = mid + 1; i <= high; i++) count += nums[i] - nums[mid];

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.