Cody

Solution 109034

Submitted on 10 Jul 2012 by Aurelien Queffurust
  • Size: 21
  • 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
%% r=2; d=3; c=counteradix(r,d); c_correct = {'000' '001' '010' '011' '100' '101' '110' '111'}; assert(isequal(c,c_correct))

ans = Columns 1 through 6 '000' '001' '010' '011' '100' '101' Columns 7 through 8 '110' '111'

2   Pass
%% assert(isequal(counteradix(3,2),{'00' '01' '02' '10' '11' '12' '20' '21' '22'}))

ans = Columns 1 through 7 '00' '01' '02' '10' '11' '12' '20' Columns 8 through 9 '21' '22'