Problem 49983. Number Puzzles - 003
Solution Stats
Problem Comments
-
8 Comments
A word to the wise: So far I have found 5 correct solutions to this problem, but they all fail the second assertion because of the way it is written. If the assertion were written as assert(y(1)*y(4)*y(6) == y(3)*y(2)*y*6) -y(5)*y(2)*y(4)), then they would all pass, but until that change is made, most correct solutions will fail. An alternative is to put a tolerance in the second assertion as it is now written.
A tolerance has been added to the test suite.
The test for unique integers has been improved to accept both row and column vectors for y. Also, the description now specifies that the integers must all be different (as that was being tested anyway).
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
431 Solvers
-
574 Solvers
-
Remove element(s) from cell array
1746 Solvers
-
Back to basics - mean of corner elements of a matrix
428 Solvers
-
1810 Solvers
More from this Author180
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!