-
1 Comment
Roie Knaanie
on 17 Dec 2022
Nice and short solution,
although it does not work for limit > 17
and inefficient in time and memory for limit > 22 .
A close solution for large N can be obtained by
limit = log(N) + O(1)
Suggested Problems
-
Find the sum of all the numbers of the input vector
50500 Solvers
-
406 Solvers
-
641 Solvers
-
112 Solvers
-
438 Solvers
More from this Author1
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!