Question: using python 5. Given a string sequence of numbers, for example: 1457848037, the four adjacent numbers that generate the largest possible product out of the
5. Given a string sequence of numbers, for example: 1457848037, the four adjacent numbers that generate the largest possible product out of the sequence are 7848, 7.8.4.8 = 1792. a) Write a function that takes two arguments: (1) the string sequence of numbers; and (2) the adjacent numbers that generate the largest product, and returns both the sequence of numbers that generates the largest product and the product itself. For example, >>> largest product('1457848037', 4) Sequence: 7848 Product: 1792 >>> largest product('55194736830570251527', 5) Sequence: 94736 Product: 4536 b) Now, use the function you created in part a) on this 10,000-digit long string to find the twenty adjacent numbers that generate the largest product. What is the largest product? What is the twenty digit sequence that generates that product
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
