Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3107. Minimum Operations to Make Median of Array Equal to K
Find the minimum number of ±1 operations to make the array's median equal to k. After sorting, only elements on the median side that lie on the "wrong" side of k must be moved, so the answer is the sum of their distances to k.
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.