Cody

Solution 716009

Submitted on 17 Aug 2015 by Jonathan
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))

s = 0 0.6931 1.7918 3.1781 4.7875 6.1738 6.5793 6.1738 4.7875 i = 3

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

s = Columns 1 through 9 1.6094 3.6889 4.3820 -Inf -Inf -Inf -Inf -Inf 9.1129 Columns 10 through 18 8.3020 7.9655 8.7765 7.2724 6.9847 -Inf -Inf -Inf -Inf Columns 19 through 27 -Inf 7.2034 -Inf -Inf -Inf -Inf -Inf 7.0493 -Inf Columns 28 through 36 -Inf -Inf -Inf -Inf 10.3451 8.9588 8.8410 -Inf -Inf Columns 37 through 45 -Inf -Inf -Inf 6.8669 6.8669 6.8669 5.4806 4.7875 3.1781 Columns 46 through 49 4.0254 -Inf -Inf -Inf i = 28

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

s = Columns 1 through 9 0 1.3863 1.3863 2.9957 5.1930 5.8861 6.2916 7.9010 7.3902 Columns 10 through 18 6.8024 8.1887 8.5942 8.9306 10.0292 9.5184 8.1321 7.0335 7.1670 Columns 19 through 27 6.3561 7.0493 7.0493 7.7424 7.0493 6.7616 6.0684 7.4547 6.7616 Columns 28 through 36 6.0684 6.9157 8.0143 7.5443 -Inf -Inf -Inf -Inf -Inf Columns 37 through 45 6.2383 7.7424 7.6089 5.5294 5.9349 8.1321 7.0335 7.2848 9.4820 Columns 46 through 51 8.7889 8.7889 9.8875 9.8875 9.8875 10.9861 i = 47

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

s = Columns 1 through 9 1.9459 4.0254 5.1240 5.1240 6.9157 6.5793 5.1930 6.0403 6.0403 Columns 10 through 18 4.9416 -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf Columns 19 through 27 6.9847 6.1738 8.2532 8.4764 8.6587 8.6587 9.4696 8.0833 7.5725 Columns 28 through 36 7.1670 7.1670 -Inf -Inf -Inf -Inf -Inf 6.3561 -Inf Columns 37 through 45 -Inf -Inf -Inf -Inf 6.1738 6.5793 6.7616 6.7616 7.7424 Columns 46 through 54 7.7424 5.9506 5.2575 4.9698 5.0876 5.4931 7.2848 -Inf -Inf Columns 55 through 58 -Inf -Inf -Inf -Inf i = 21

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

s = Columns 1 through 9 1.9459 -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf Columns 10 through 18 -Inf 6.1092 6.3969 7.3778 7.3778 7.7142 7.4911 7.4911 7.4911 Columns 19 through 27 7.4911 7.1546 6.4615 -Inf -Inf -Inf -Inf -Inf -Inf Columns 28 through 36 -Inf -Inf 7.4547 7.4547 6.3561 7.2724 6.5793 -Inf -Inf Columns 37 through 45 -Inf -Inf -Inf 5.7526 4.6540 6.4457 5.8861 6.9847 7.1670 Columns 46 through 54 8.0143 8.3020 9.1129 8.7075 8.5252 8.7765 -Inf -Inf -Inf Columns 55 through 63 -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf Columns 64 through 68 -Inf -Inf -Inf -Inf -Inf i = 44

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

s = 0 0 0 0 0 i = 1

Suggested Problems

More from this Author95