Cody

Solution 2032236

Submitted on 22 Nov 2019 at 16:37 by Asif Newaz
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))

a = 9 b = 120 b = 120 480 b = 120 480 720 b = 120 480 720 480 b = 120 480 720 480 120 i = 3

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

a = 49 b = 0 b = 0 0 b = 0 0 0 b = 0 0 0 0 b = 0 0 0 0 9072 b = 0 0 0 0 9072 4032 b = 0 0 0 0 9072 4032 2880 b = 0 0 0 0 9072 4032 2880 6480 b = 0 0 0 0 9072 4032 2880 6480 1440 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 0 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 b = 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Column 16 1344 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 17 1344 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 18 1344 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 19 1344 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 20 1344 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 21 1344 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 22 1344 0 0 0 0 0 1152 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 23 1344 0 0 0 0 0 1152 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 24 1344 0 0 0 0 0 1152 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 25 1344 0 0 0 0 0 1152 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 26 1344 0 0 0 0 0 1152 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 27 1344 0 0 0 0 0 1152 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 28 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 29 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Column 31 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 32 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 33 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 34 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 35 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 36 0 0 0 0 0 960 b = Columns 1 through 15 0 0 0 0 9072 4032 2880 6480 1440 1080 0 0 0 0 0 Columns 16 through 30 1344 0 0 0 0 0 1152 0 0 0 0 0 31104 7776 6912 Columns 31 through 37 0 0 0 0 0 960 960 b = Columns 1 through 15...

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

a = 51 b = 180 b = 180 360 b = 180 360 540 b = 180 360 540 2700 b = 180 360 540 2700 1620 b = 180 360 540 2700 1620 900 b = 180 360 540 2700 1620 900 3600 b = 180 360 540 2700 1620 900 3600 5400 b = 180 360 540 2700 1620 900 3600 5400 7560 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 b = 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Column 16 1152 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 17 1152 1152 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 18 1152 1152 2304 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 19 1152 1152 2304 1152 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 20 1152 1152 2304 1152 864 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 21 1152 1152 2304 1152 864 432 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 22 1152 1152 2304 1152 864 432 1728 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 23 1152 1152 2304 1152 864 432 1728 864 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 24 1152 1152 2304 1152 864 432 1728 864 432 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 25 1152 1152 2304 1152 864 432 1728 864 432 1008 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 26 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 27 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 28 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 29 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Column 31 0 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 32 0 0 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 33 0 0 512 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 34 0 0 512 2304 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 35 0 0 512 2304 2016 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 36 0 0 512 2304 2016 252 b = Columns 1 through 15 180 360 540 2700 1620 900 3600 5400 7560 22680 13608 3402 1134 1296 576 Columns 16 through 30 1152 1152 2304 1152 864 432 1728 864 432 1008 3024 1890 0 0 0 Columns 31 through 37 0 0 512 2304 2016 252 378 b =...

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

a = 58 b = 1008 b = 1008 720 b = 1008 720 180 b = 1008 720 180 420 b = 1008 720 180 420 420 b = 1008 720 180 420 420 140 b = 1008 720 180 420 420 140 0 b = 1008 720 180 420 420 140 0 0 b = 1008 720 180 420 420 140 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 b = 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Column 16 480 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 17 480 3840 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 18 480 3840 4800 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 19 480 3840 4800 5760 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 20 480 3840 4800 5760 5760 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 21 480 3840 4800 5760 5760 12960 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 22 480 3840 4800 5760 5760 12960 3240 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 23 480 3840 4800 5760 5760 12960 3240 1944 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 24 480 3840 4800 5760 5760 12960 3240 1944 1296 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 25 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 26 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 27 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 28 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 29 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Column 31 576 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 32 576 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 33 576 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 34 576 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 35 576 0 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 36 576 0 0 0 0 0 b = Columns 1 through 15 1008 720 180 420 420 140 0 0 0 0 0 0 0 0 1080 Columns 16 through 30 480 3840 4800 5760 5760 12960 3240 1944 1296 1296 0 0 0 0 0 Columns 31 through 37 576 0 0 0 ...

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

a = 68 b = 0 b = 0 0 b = 0 0 0 b = 0 0 0 0 b = 0 0 0 0 0 b = 0 0 0 0 0 0 b = 0 0 0 0 0 0 450 b = 0 0 0 0 0 0 450 600 b = 0 0 0 0 0 0 450 600 1600 b = 0 0 0 0 0 0 450 600 1600 1600 b = 0 0 0 0 0 0 450 600 1600 1600 2240 b = 0 0 0 0 0 0 450 600 1600 1600 2240 1792 b = 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 b = 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 b = 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Column 16 1280 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 17 1280 640 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 18 1280 640 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 19 1280 640 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 20 1280 640 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 21 1280 640 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 22 1280 640 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 23 1280 640 0 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 24 1280 640 0 0 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 25 1280 640 0 0 0 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 26 1280 640 0 0 0 0 0 0 0 0 1728 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 27 1280 640 0 0 0 0 0 0 0 0 1728 1728 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 28 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 29 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Column 31 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 32 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 33 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 34 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 35 0 0 0 0 0 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 36 0 0 0 0 0 315 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 1792 1792 1792 Columns 16 through 30 1280 640 0 0 0 0 0 0 0 0 1728 1728 576 1440 720 Columns 31 through 37 0 0 0 0 0 315 105 b = Columns 1 through 15 0 0 0 0 0 0 450 600 1600 1600 2240 1792 17...

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

a = 5 b = 1 i = 1