Problem 1103. Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
Solution Stats
Problem Comments
-
2 Comments
Hi Team,
I am getting error after submitting as,
"We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly"
But completion bar has been incremented.
Thanks and Have a Good DaY
Well I don't know why I can't pass the test
could anyone help
function c = right_triangle_sides(p)
c = {};
k=1;
for i=1:ceil(p/3)
for j=i:ceil((p-i)/2)
if i^2+j^2==(p-i-j)^2
c(k)=mat2cell([i j p-i-i],1);
k=k+1;
end
end
end
end
Solution Comments
-
2 Comments
So great!
great!
-
1 Comment
very challenging
-
2 Comments
I think, the statement of the problem is not complete. The reference problem is not available. I know very well about right angle triangles but I do not have the idea on how to find the solutions. Please help me out.
Hi Castillo,
it is just iteration of 3 sides using perimeter and summing up the three iteration variable for perimeter check then for right angle triangle check (Pythagoras)...
Hope this helped you...(:
-
1 Comment
Thank you :)
-
1 Comment
Works, but is horribly inefficient especially for higher p...
-
1 Comment
solution using a Neural Network Toolbox function ;)
Problem Recent Solvers1302
Suggested Problems
-
1853 Solvers
-
220 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
434 Solvers
-
320 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
635 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!