Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 405 Bytes

File metadata and controls

7 lines (5 loc) · 405 Bytes

Write a function is_right_triangle(a: int, b: int, c: int) -> bool that takes three side lengths and returns True if they form a right triangle.

A right triangle satisfies the Pythagorean Theorem: the square of the longest side must equal the sum of the squares of the other two sides.

For example:

  • 3, 4, 5 forms a right triangle (since 3² + 4² = 5²).
  • 5, 12, 13 is also a right triangle.