Cody

Solution 2214588

Submitted on 16 Apr 2020 by Simon Hönes
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
s = '123454321'; i_correct = 3; assert(isequal(running_product(s),i_correct))

result = 120 i = 1 result = 480 i = 2 result = 720 i = 3

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

result = 9072 i = 5 result = 31104 i = 28

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

result = 180 i = 1 result = 360 i = 2 result = 540 i = 3 result = 2700 i = 4 result = 3600 i = 7 result = 5400 i = 8 result = 7560 i = 9 result = 22680 i = 10 result = 59049 i = 47

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

result = 1008 i = 1 result = 1080 i = 15 result = 3840 i = 17 result = 4800 i = 18 result = 5760 i = 19 result = 12960 i = 21

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

result = 450 i = 7 result = 600 i = 8 result = 1600 i = 9 result = 2240 i = 11 result = 3024 i = 42 result = 4032 i = 43 result = 9072 i = 44

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

result = 1 i = 1

Suggested Problems

More from this Author95