Problem 9: Special Pythagorean triplet
Problem Explanation
- In this challenge we need to find the pythagorean triple.
- We have the following information -
a < b < c
- Based on this, we can make a loop starting from
a = 0
andb = a
sincea < b
always. - We also know that
a + b + c = n
anda^2 + b^2 = c^2
, since we havea
,b
andn
. We can findc
and see if it satisfies the triplet theorem.