Cody

# Problem 713. Find the maximum number of decimal places in a set of numbers

Solution 1871311

Submitted on 11 Jul 2019 by Be Matlabi
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
x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.31; 5.00010 6.429 7.492 8.0]; y_correct = 4; assert(isequal(find_max_sigdec(x),y_correct))

temp = 2 temp = 4 temp = 2 temp = 2 temp = 3 temp = 2 temp = 1 temp = 3 temp = 1 temp = 2

2   Pass
N = randi(6,1); x1 = rand(1,100); for k = 1:100 x(1,k) = round(x1(1,k)*10^N)/10^N; end assert(isequal(find_max_sigdec(x), N))

temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1 temp = 1

3   Pass
N = randi(6,1); a = rand(5,20); for k = 1:20 for m = 1:5 x(m,k) = round(a(m,k)*10^N)/10^N; end end assert(isequal(find_max_sigdec(x), N))

temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 3 temp = 5 temp = 5 temp = 4 temp = 5 temp = 3 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 4 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5 temp = 5

4   Pass
x = 1; assert(isequal(find_max_sigdec(x), 0))