Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them comprise sides of a right-angled triangle. Return true if they do, otherwise return false .
See Problem 1550 Can I make a right triangle ?
Thanks Tanya, have enjoyed these.
The cases are very limited to make such a code valid
flag = false;
flag = true;
This is not a valid solution to this puzzle!!
This is a smart solution that is not cheating the system.
Lol saying great work on your own solution :P
Great work :)
Haha that's how we roll!
why the leading solution size is always 10, how could that possible?
Yeah, I know this is cheating, taking advantage of the limited test suite. I just wanted to see what the other small scores were about.
i need to change this
hardcore brute force
Should work for any case and doesn't contain str2num or regexp :)
Fifth test cannot be true because 3.5^2 = 12.25
and no integer after squaring and adding will give such result
how can this be a leading solution?? Are all the cody problems like this?
I don't understand this solution. Can you explain it ?
Still without str2num or regexp
this would fail on assert(isequal(isTherePythagoreanTriple(1,4,7,9),false))
The benefit of a limited test suite.
Without using str2num or regexp
Find state names that end with the letter A
Find the peak 3n+1 sequence value
Implement a ROT13 cipher
Can we make a triangle?
Dimensions of a rectangle
Is this triangle right-angled?
Length of the hypotenuse
Length of a short side
Area of an equilateral triangle
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office