Cody

Problem 43676. Count the Digits in the Box

Solution 1913085

Submitted on 27 Aug 2019
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   Fail
extras = 22222; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test1 (line 2) censusIn = getDigitCensus(extras)

2   Fail
extras = 6380059; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test2 (line 2) censusIn = getDigitCensus(extras)

3   Fail
extras = 99999432; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test3 (line 2) censusIn = getDigitCensus(extras)

4   Fail
extras = 347879; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test4 (line 2) censusIn = getDigitCensus(extras)

5   Fail
extras = 83870955; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test5 (line 2) censusIn = getDigitCensus(extras)

6   Fail
extras = 1111111111; censusIn = getDigitCensus(extras) str = string(censusIn); censusOut = histc(char([str{:}]+string(extras))-48,0:9)+1; assert(isequal(censusIn,censusOut))

Undefined function or variable 'a'. Error in getDigitCensus (line 2) s = num2str(a)-'0' Error in Test6 (line 2) censusIn = getDigitCensus(extras)