This solution is outdated. To rescore this solution, sign in.
-
2 Comments
David Motson
on 12 Nov 2019
I discovered using a for loop doesn't work - too slow. Then I realised that randi can generate the required vector, doh!
Gabriel Gomes
on 19 Mar 2020
Can anyone do that in a size smaller than 22? That was the smallest size I could get.
Suggested Problems
-
3357 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2501 Solvers
-
Are all the three given point in the same line?
583 Solvers
-
15430 Solvers
-
find the surface area of a cube
537 Solvers
More from this Author13
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!