Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2567. Minimum Score by Changing Two Elements
Given an integer array where you may replace any two elements arbitrarily, minimize the sum of the maximum and minimum pairwise absolute differences (which, since you can create duplicates, reduces to minimizing the array range after two edits). This is solved by sorting and considering which two endpoints to adjust to get the smallest possible max−min.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.