Problem 84. Longest Divisor Run
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
This scoring method leads to horrible coding. This is teaching horrible coding. No actual code should ever use ans.
-
2 Comments
-
1 Comment
I am passing all test suit case in MATLAB 207b but I am getting this message:
While evaluating the solution, the server encountered an error caused by long running MATLAB code. Edit the code if needed and then submit.
-
1 Comment
Based on Gangyi's solution (Solution 57169). (And with thanks to Alfonso for directing my attention towards it. :-)
-
1 Comment
Flawed solution; it fails when (for example) a = [2 10 20 30] .
-
1 Comment
This Solution is a little difficult to obtain,but seems like an approach.
-
1 Comment
This iterationg is good indeed.
-
1 Comment
good trick
-
3 Comments
Yes, the size matters for this scoring, but using m(a)=0 makes for a grossly large vector. I'm not a big fan of this type of solution, which seems to make up the shortest solutions.
If you do not care about Cody-'size' solution 66088 implements the same algorithm more efficiently (using sparse vectors instead of a 'grossly large' matrix)...
my personal favourite nevertheless is Gangyi's 57169 solution, which seems to run typically twice as fast a my version...
Problem Recent Solvers982
Suggested Problems
-
Is my wife right? Now with even more wrong husband
1304 Solvers
-
449 Solvers
-
870 Solvers
-
Find nearest prime number less than input number
461 Solvers
-
Create matrix of replicated elements
363 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!