Problem 2022. Find a Pythagorean triple
Solution Stats
Problem Comments
-
11 Comments
roundup the numbers before comparing
I think for Test-7 , problem creator @Tanya should add "~" to the "flag_correct" part of the line:
assert(isequal(isTherePythagoreanTriple(a, b, c, d),flag_correct))
so it should be changed to :
assert(isequal(isTherePythagoreanTriple(a, b, c, d),~flag_correct))
Pythagorean triplets are taken as positive integers , one of the test case uses irrational number for inputs ! I wish the test creator
@Tanya Morton makes appropriate change as suggested by @Sophia
Solution Comments
Show commentsProblem Recent Solvers4747
Suggested Problems
-
Given two arrays, find the maximum overlap
1609 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1201 Solvers
-
Back to basics 8 - Matrix Diagonals
936 Solvers
-
Find the maximum number of decimal places in a set of numbers
3031 Solvers
-
Who has power to do everything in this world?
454 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!