Cody

Problem 45352. Number generator

Solution 2137101

Submitted on 22 Feb 2020 by Gatech AE
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(number_gen(74562),168))

l = 5 v = 0 0 0 0 0 y = [] y = '168'

2   Pass
assert(isequal(number_gen(74561562),16713))

l = 8 v = 0 0 0 0 0 0 0 0 y = [] y = '16713'

3   Pass
assert(isequal(number_gen(111111111111),222222))

l = 12 v = 0 0 0 0 0 0 0 0 0 0 0 0 y = [] y = '222222'

4   Pass
assert(isequal(number_gen(1111111111111),2222221))

l = 13 v = 0 0 0 0 0 0 0 0 0 0 0 0 0 y = [] y = '2222221'

5   Pass
assert(isequal(number_gen(3456696524532), 122111115))

l = 13 v = 0 0 0 0 0 0 0 0 0 0 0 0 0 y = [] y = '122111115'

6   Pass
assert(isequal(number_gen(100000024008),15))

l = 12 v = 0 0 0 0 0 0 0 0 0 0 0 0 y = [] y = '15'

7   Pass
assert(isequal(number_gen(288624888862),70))

l = 12 v = 0 0 0 0 0 0 0 0 0 0 0 0 y = [] y = '70'

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!