Pythagorean triplets

Pythagorean triplets are triplets that satisfy the condition that a2+b2=c2a^{2}+b^{2}=c^{2} such that a<b<ca<b<c. Given an unsorted array of unique integers in the text file, how many Pythagorean triplets are there?

As an explicit example, in the array [3,7,10,6,4,8,5,11][3,7,10,6,4,8,5,11], there are 22 Pythagorean Triplets, namely (3,4,5)(3, 4, 5) and (8,6,10)(8, 6, 10).

×

Problem Loading...

Note Loading...

Set Loading...