Cody

Problem 1103. Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

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

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

Given any value of p, return a cell array whose elements are the sorted side lengths of a possible right triangle whose perimeter is p. Furthermore, the elements of the output should be sorted by their shortest side length.

Solution Stats

45.12% Correct | 54.88% Incorrect
Last solution submitted on Sep 21, 2016

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more