Problem 1103. Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
Solution Stats
Problem Comments
-
5 Comments
To creator of this group,
Please check the test case 3 in the Problem of calculating side length from area of triangle. One ';' is missing which is not allowing the case to pass for correct solution.
This problem really highlights problems with the Cody scoring system. The score using a double for loop to brute force the lengths beats out a single for loop using equations. I tested my code in Matlab vs double loops and it's faster than most double loops I tested by several orders of magnitude for larger numbers (p>1000). There is also some sort of caching going on where my code gets orders of magnitude faster again if ran a few times vs most double for loops.
There is one exception with a double loop that is really fast by Hung Hoang. They use the for loops in a way that doesn't make it O^2.
interesting problem
Solution Comments
Show commentsProblem Recent Solvers1888
Suggested Problems
-
7723 Solvers
-
Find relatively common elements in matrix rows
2087 Solvers
-
1828 Solvers
-
507 Solvers
-
Sum the numbers on the main diagonal
590 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!