Problem Statement:
Given an array a of n integers find all possible Pythagorean triplets from the array.
What is Pythagorean triplet?
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=> a2 + b2 = c2“.

Pythagorean Triplet
Solution:
[Read more…]