a right triangle's longest side is the hypotenuse
let x=longest, y=middle, and z=shortest
x=y+2
y=2z-1
therefore x=(2z-1)+2=2z+1
find z
z^2+y^2=x^2 by Pythagorean theorem
plug in x and y in terms of z
z^2+(2z-1)^2=(2z+1)^2
z^2+4z^2-4z+1=4z^2+4z+1
subtract the right-hand side's value from the left-hand side's
z^2-8z=0
z(z-8)=0
z=0, 8
z cannot be zero as the sides must have some value to it.
Therefore the shortest side is equal to 8