In a right triangle, the hypotenuse is 5 units long.
let other sides be a and b
a, b < 5 as 5 is hypotenuse
and a^2 + b^2 = 5^2 for right triangle
the legs also have integer lengths so a and b are integers
a and b can only be 1, 2, 3 or 4
by trial and error, a, b are 3 and 4