#3774
Absolute Difference Between Maximum and Minimum K Elements
newbie · 240 · lc easy +18 · 75.4% accepted · 38 likes · top 86%
Description
Given an integer array nums and an integer k, compute and return the absolute difference between the sum of the k largest elements and the sum of the k smallest elements in nums.
Code
1
2
3