Back to course home
0% completed
Vote For New Content
Sorry I don't understand the calculating part, can you elaborate more on it?
HaoPo Yang
Jul 22, 2024
I know the prefix and suffix sum, but I'm still confused with it...
0
0
Comments
Comments
Shubham Voraa year ago
Let's break down the calculation part of the code:
The formula used to calculate result[i] is:
result[i] = i * nums[i] - left_sum + right_sum - (n - i - 1) * nums[i]
This formula is used to find the sum of absolute differences between nums[i] ...