March to the Median — Solution & Editorial
The optimal meeting value is any median (it minimizes the sum of absolute deviations); sum |ai − median|.
Complexity: O(N log N)
Watch out: The MEAN feels right but is wrong for absolute cost — the median wins (try 1, 2, 9).