The problem is in the title. Here is a detailed description:
Let's say we have list $[x_i]_{i=1}^{i=n}$ where $x_i\in\Bbb{N}$. I want to pick such $m\in\Bbb{N}$ which minimises the sum $\sum_{i=1}^{i=n} |x_i-m|$.
In my computer science class we had a problem which was equivalent to the upper one. And apparently the answer was that the $m$ we should choose is the median of the list. But no one has proven it, and I have a hard time seeing why that is the case and not for example arithmetic mean of the list.
What strategy should I use in order to prove that?