There is nothing wrong with your approach. Let $x$ be the shortest side. Then, the other perpendicular side has length $x+10$ and the hypotenuse has length $x+15$. Thus, by the Pythagorean theorem,
$$ \begin{aligned} x^{2}+(x+10)^{2}=(x+15)^{2}&\implies x^{2}+x^{2}+20x+100=x^{2}+30x+225\\\ &\implies x^{2}-10x-125=0\\\ &\implies x=\frac{10\pm\sqrt{100+500}}{2}=5\pm 5\sqrt{6} \end{aligned} $$
Since $x$ must be positive, $x=5+5\sqrt{6}$. Therefore, the length of the hypotenuse is $20+5\sqrt{6}$.