Cody

Problem 45343. How lucky r u ?

Solution 2984656

Submitted on 23 Sep 2020 at 23:10 by Alfonso Nieto-Castanon
  • Size: 65
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(lucky(1),0))

2   Pass
assert(isequal(lucky(5),3))

3   Pass
assert(isequal(lucky(12),2))

4   Pass
assert(isequal(lucky(19),7))

5   Pass
assert(isequal(lucky(27),9))

6   Pass
assert(isequal(lucky(31),0))

7   Pass
assert(isequal(lucky(37),0))

8   Pass
assert(isequal(lucky(45),13))

9   Pass
assert(isequal(lucky(55),15))

10   Pass
assert(isequal(lucky(85),21))

11   Pass
assert(isequal(lucky(185),3))

12   Pass
assert(isequal(lucky(303),0))

13   Pass
assert(isequal(lucky(555),13))

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!