Cody

Solution 337099

Submitted on 22 Oct 2013 by Swapnali Gujar
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
%% n = 1; max_n = 9; n_str = '1'; assert(isequal(betterIndexNum(n,max_n),n_str))

2   Pass
%% n = 1; max_n = 28; n_str = '01'; assert(isequal(betterIndexNum(n,max_n),n_str))

n_str = 01

3   Pass
%% n = 28; max_n = 848984; n_str = '000028'; assert(isequal(betterIndexNum(n,max_n),n_str))

n_str = 028 n_str = 0028 n_str = 00028 n_str = 000028

4   Pass
%% n = 10; max_n = 100; n_str = '010'; assert(isequal(betterIndexNum(n,max_n),n_str))

n_str = 010