Cody

# Problem 54. Maximum running product for a string of numbers

Solution 2639842

Submitted on 1 Jul 2020
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
s = '123454321'; i_correct = 3; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 9 a = 1×1 cell array {'123454321'} max = int32 1

Index exceeds the number of array elements (1). Error in Test1 (line 3) assert(isequal(running_product(s),i_correct))

2   Fail
s = '5820974944592307816406286208998628034825342117067'; i_correct = 28; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 49 a = 1×1 cell array {'5820974944592307816406286208998628034825342117067'} max = int32 1

Index exceeds the number of array elements (1). Error in Test2 (line 3) assert(isequal(running_product(s),i_correct))

3   Fail
s = '141592653589793238462643383279502884197169399399999'; i_correct = 47; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 51 a = 1×1 cell array {'141592653589793238462643383279502884197169399399999'} max = int32 1

Index exceeds the number of array elements (1). Error in Test3 (line 3) assert(isequal(running_product(s),i_correct))

4   Fail
s = '7831652712019091456485669234603486104543266482133936072602'; i_correct = 21; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 58 a = 1×1 cell array {'7831652712019091456485669234603486104543266482133936072602'} max = int32 1

Index exceeds the number of array elements (1). Error in Test4 (line 3) assert(isequal(running_product(s),i_correct))

5   Fail
s = '70066063155881748815209209628292540917153643678925903600113305305488'; i_correct = 44; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 68 a = 1×1 cell array {'70066063155881748815209209628292540917153643678925903600113305305488'} max = int32 1

Index exceeds the number of array elements (1). Error in Test5 (line 3) assert(isequal(running_product(s),i_correct))

6   Fail
s = '11111'; i_correct = 1; assert(isequal(running_product(s),i_correct))

pr = int32 1 n = 5 a = 1×1 cell array {'11111'} max = int32 1

Index exceeds the number of array elements (1). Error in Test6 (line 3) assert(isequal(running_product(s),i_correct))