Let $X_1,X_2,\ldots,X_n$ be i.i.d random variables with pdf
$$f(x\mid\theta)=\begin{cases}\frac{2(\theta-x)}{\theta^2}&,\text{ if }0<x<\theta \\ 0 &,\text{ otherwise }\end{cases}$$
What is the maximum likelihood estimator of $\theta$ ?
I know how to find MLE of uniform and exponential functions like maximising log likelihood etc. But I am unable to figure out the mle in the above case.