Find all the pythagorean triplets in an array of integer
Given an array a of n integers find all possible Pythagorean triplets from the array.
A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. this formula is derived from Pythagoras theorem: _“For every right angle triangle with side lengths a, b, and c=> a_2 + b2 = c2“.
Solution:
Conceptually it is similar to Find Non duplicate pairs that sum to S and 3 SUM problem
[Read More]