Right Triangle Side Lengths (Inspired by Project Euler Problem 39) - MATLAB Cody - MATLAB Central

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

Difficulty:Rate
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

34.99% Correct | 65.01% Incorrect
Last Solution submitted on Mar 15, 2025

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers1888

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page