




Sponsored
Use these hints if you're stuck. Try solving on your own first.
Obviously, brute force won't help here. Think of something else, take some example like 1,2,3,4.
How will you make pairs to get the result? There must be some pattern.
Did you observe that- Minimum element gets add into the result in sacrifice of maximum element.
Still won't able to find pairs? Sort the array and try to find the pattern.