Cody

# Problem 43676. Count the Digits in the Box

Solution 1913087

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))

s = 2 2 2 2 2 c = [] c = 0 c = 0 0 c = 0 0 5 c = 0 0 5 0 c = 0 0 5 0 0 c = 0 0 5 0 0 0 c = 0 0 5 0 0 0 0 c = 0 0 5 0 0 0 0 0 c = 0 0 5 0 0 0 0 0 0 c = 0 0 5 0 0 0 0 0 0 0 censusIn = 0 0 5 0 0 0 0 0 0 0

Assertion failed.

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

s = 6 3 8 0 0 5 9 c = [] c = 2 c = 2 0 c = 2 0 0 c = 2 0 0 1 c = 2 0 0 1 0 c = 2 0 0 1 0 1 c = 2 0 0 1 0 1 1 c = 2 0 0 1 0 1 1 0 c = 2 0 0 1 0 1 1 0 1 c = 2 0 0 1 0 1 1 0 1 1 censusIn = 2 0 0 1 0 1 1 0 1 1

Assertion failed.

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

s = 9 9 9 9 9 4 3 2 c = [] c = 0 c = 0 0 c = 0 0 1 c = 0 0 1 1 c = 0 0 1 1 1 c = 0 0 1 1 1 0 c = 0 0 1 1 1 0 0 c = 0 0 1 1 1 0 0 0 c = 0 0 1 1 1 0 0 0 0 c = 0 0 1 1 1 0 0 0 0 5 censusIn = 0 0 1 1 1 0 0 0 0 5

Assertion failed.

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

s = 3 4 7 8 7 9 c = [] c = 0 c = 0 0 c = 0 0 0 c = 0 0 0 1 c = 0 0 0 1 1 c = 0 0 0 1 1 0 c = 0 0 0 1 1 0 0 c = 0 0 0 1 1 0 0 2 c = 0 0 0 1 1 0 0 2 1 c = 0 0 0 1 1 0 0 2 1 1 censusIn = 0 0 0 1 1 0 0 2 1 1

Assertion failed.

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

s = 8 3 8 7 0 9 5 5 c = [] c = 1 c = 1 0 c = 1 0 0 c = 1 0 0 1 c = 1 0 0 1 0 c = 1 0 0 1 0 2 c = 1 0 0 1 0 2 0 c = 1 0 0 1 0 2 0 1 c = 1 0 0 1 0 2 0 1 2 c = 1 0 0 1 0 2 0 1 2 1 censusIn = 1 0 0 1 0 2 0 1 2 1

Assertion failed.

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

s = 1 1 1 1 1 1 1 1 1 1 c = [] c = 0 c = 0 10 c = 0 10 0 c = 0 10 0 0 c = 0 10 0 0 0 c = 0 10 0 0 0 0 c = 0 10 0 0 0 0 0 c = 0 10 0 0 0 0 0 0 c = 0 10 0 0 0 0 0 0 0 c = 0 10 0 0 0 0 0 0 0 0 censusIn = 0 10 0 0 0 0 0 0 0 0

Assertion failed.