Bayesian Statistics: Finding Sufficient Statistic for Uniform Distribution The example: let $y_1,\dots,y_n \overset{\text{i.i.d.}}\sim U([0,\theta])$, where $\theta >0$ is unknown. Find a sufficient statistic for $\theta$.
Solution attempt: 
$$g(y_1,\dots,y_n) = c\quad \text{(constant)}$$
$$P(y_i\mid\theta) = \frac{1}{\theta}\quad \text{ for } 0<y_i<\theta$$
$$P(y_1,\dots,y_n\mid\theta) = \prod_{i=1}^n P(y_i\mid\theta) = \frac{1}{\theta^n}\quad\text{ for } 0<y_1,\dots,y_n<\theta$$
Now this is where I got stuck. I have seen this post about Sufficient Statistic but I am still stuck. Could somebody help me find a sufficient statistic for this problem? (I think maybe taking the average or the maximum value of $y_i$s might work but not sure how to do the next step)

I find it at best irritating to use the same symbol to refer both to the random variable and to the argument to the density function.  We can understand such things as $\Pr(Y\le y) = (\text{a certain function of } y)$ because capital $Y$ and lower-case $y$ mean two different things.
Write the density like this and see if you can do something with that:
$$
f_{Y_1,\ldots,Y_n}(y_1,\dots,y_n\mid\theta) = \prod_{i=1}^n P(y_i\mid\theta) = \begin{cases} 1/\theta^n & \text{if } \max\{y_1,\ldots,y_n\}\le\theta, \\
0 & \text{if } \max\{y_1,\ldots,y_n\} >\theta, \end{cases}
$$
