Project Euler Problem 39 Solution

Question

If pp is the perimeter of a right angle triangle with integral length sides, {a,b,c}\{a,b,c\}, there are exactly three solutions for p=120p = 120.

{20,48,52},{24,45,51},{30,40,50}\{20,48,52\}, \{24,45,51\}, \{30,40,50\}

For which value of p1000p \leq 1000, is the number of solutions maximised?

Haskell

Python

Ruby