The answer (minimizer) in this case is $10$, the median of the sequence $$(1,2,5,6,8,9,10,11,12,17,24,31,32).$$
You can plug in $x=10$ in the function and you would find that the minimum value is $96$. In general, the solution to the following minimization problem
$$\min\{|x-a_1| + |x-a_2| + \cdots + |x-a_n|\}$$
is the median of $(a_1,\ldots,a_n)$. To see why, consider first when $n=2$, and without loss of generality assume $a_1<a_2$. Then $|x-a_1|+|x-a_2|$ is the distance between $x$ and $a_1$ plus the distance between $x$ and $a_2$. It is easy to see that only when $x$ is in the middle of $a_1$ and $a_2$ should the sum of distances be minimal, which equals $|a_2-a_1|$ in this case. In this case the minimizer is not unique. Any points in $[a_1,a_2]$ is a minimizer.
When $n=3$, the function is $|x-a_1|+|x-a_2|+|x-a_3|$, and we order the parameters again so that $a_1<a_2<a_3$. When $x$ coincides with $a_2$, i.e. $x=a_2$, the value becomes $|a_2-a_1|+|a_2-a_3|=|a_3-a_1|$, the distance between $a_3$ and $a_1$. But when $x\in[a_1,a_3], x\neq a_2$, the value of the function is
$$|x-a_2|+|x-a_1|+|x-a_3| = |a_3-a_1| + |x-a_2|,$$
which is largar than $|a_3-a_1|$, the distance between $a_3$ and $a_1$. Similarly the value would become larger when $x$ is outside $[a_1,a_3]$. So in this case, the minimizer is unique and is equal to $a_2$, the median of $(a_1,a_2,a_3)$.
In general, when $n$ is odd, there exists a unique minimizer, which is equal to the (unique) median of the parameters $(a_1,\ldots,a_n)$. When $n$ is even, the function is minimal and constant over the range $[a_i,a_j]$, where $a_i$ and $a_j$ are the two middle values.