Problem 2023. Is this triangle right-angled?
Solution Stats
Problem Comments
-
4 Comments
among a,b,c., specify the hypotenuse.
that's the tricky part here ;) Check all combinations - too bad 'combvec' doesnt work here
Passes for True, but Failing when I get to false test?? Not sure at the moment what I could be missing.
I'd like to suggest an additional test case such as
a = sqrt(10); b = 3; c = 1;
Here the result is "true", but some of the existing solutions won't work because of rounding errors.
Solution Comments
-
1 Comment
Try to remove if statement and Hyp and got one line solution:
flag = ~(-a^2 - b^2 - c^2 + 2*max([a,b,c])^2);
-
1 Comment
nice
-
3 Comments
tricky
Good problem
good problem
-
1 Comment
A great example!
-
1 Comment
challenging!
-
1 Comment
Yes, I finally got it
-
1 Comment
The 2nd test is incorrect.
-
1 Comment
Creative solution :D
-
1 Comment
why is it correct? only because the test case.
a=100, b=20, c=5 will flag true but it not true
-
1 Comment
Without using str2num or regexp
Problem Recent Solvers4609
Suggested Problems
-
Set the array elements whose value is 13 to 0
1292 Solvers
-
515 Solvers
-
There are 10 types of people in the world
796 Solvers
-
Calculate the average value of the elements in the array
706 Solvers
-
399 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!