Let $X_1,...,X_n$ have density:
$$f(x;\theta) = \begin{cases} 1 & \text{if } \theta-1/2<x< \theta+1/2 \\ 0 & \text{otherwise} \end{cases}$$
Let $Y_1=\min \lbrace X_1,\ldots,X_n \rbrace$ and $Y_n=\max \lbrace X_1,\ldots,X_n\rbrace$
Show that any statistic $u(X_1,\ldots,X_n)$ that satisfies $Y_n-1/2<u<Y_1+1/2$ is a maximum likelihood estimate of $\theta$.
My attempt:
First rewrite the density:
$$f(x;\theta) = \begin{cases} 1 &\text{if } -1/2<x- \theta<1/2 \\ 0 & \text{otherwise} \end{cases}$$
Okay, so we obviously need to use the fact that $Y_n-1/2<u<Y_1+1/2$, I started by using the regular MLE finding method:
$$L(\theta)=\prod_i(x-\theta)$$
$$\log L(\theta)=\log\prod_i(x_i-\theta)=\sum_i \log(x_i- \theta)$$
$$(\log L(\theta))'=\sum_i \frac 1 {x_i- \theta} =0$$
And I'm stuck here..I think that I need to use the given here but I'm not sure how to proceed.
Any help would really be appreciated:) Thanks!