I need help with this geometry question I’m confused for some reason.

We are asked to determine which of the triangles is a right triangle. To do that we can apply the Pythagorean theorem, taking the larger side as the hypotenuse. If the Equality of the Pythagorean theorem holds, then the triangle is a right triangle.
Let's take triangle P. The largest side is 30, therefore, we take this as the hypotenuse. The Pythagorean theorem is as follows:
[tex]h^2=a^2+b^2[/tex]Where:
[tex]\begin{gathered} h=\text{ hypotenuse} \\ a,b=\text{ sides} \end{gathered}[/tex]Now we substitute the values:
[tex]30^2=12^2+24^2[/tex]Now we solve the squares:
[tex]900=144+576[/tex]Adding the terms:
[tex]900=720[/tex]Since the terms on the right side and the left side are not equal, this means that the given triangle is not a right triangle.
Now, let's do the same procedure for triangle Q. We have that the hypotenuse in this triangle is 41. Therefore, substituting in the Pythagorean theorem we get:
[tex]41^2=40^2+9^2[/tex]Solving the square:
[tex]1681=1600+81[/tex]Adding the terms:
[tex]1681=1681[/tex]Since we got the same result on both sides this means that the triangle Q is a right triangle.