Pythagorean triplet in an integer array


suggest an algorithm that finds all Pythagorean triplets among numbers in a given array.
Pythagorean triplet is a set {a,b,c} such that a2 = b2 + c2. Example: for array [9, 2, 3, 4, 8, 5, 6, 10] the output of the algorithm should be {3, 4, 5} and {6, 8, 10}.

Comments

Popular posts from this blog