Check a Pythagorean Triple

Given an array values containing exactly three positive integers, return true if the three values can be the side lengths of a right triangle and false…

Given an array `values` containing exactly three positive integers, return `true` if the three values can be the side lengths of a right triangle and `false` otherwise. The input order does not matter. If the sorted values are `a ≤ b ≤ c`, they form a Pythagorean triple exactly when `a² + b² = c²`.

- `values.length = 3` - `1 ≤ values[i] ≤ 10^4`

Example 1: input values = [3, 4, 5]; output true. 3² + 4² equals 5².

Example 2: input values = [13, 5, 12]; output true. After ordering the sides, 5² + 12² equals 13².

Example 3: input values = [2, 3, 4]; output false. No ordering satisfies the Pythagorean equation.

Category: Math. Topic: math. Difficulty: Easy. Patterns: math.