Question: Use Python: Look and Say: There is a particular sequence named 'Look and Say' sequence. The sequence begins with a single digit in which the

Use Python: Look and Say:
There is a particular sequence named 'Look and Say' sequence. The sequence begins
with a single digit in which the next term is obtained by describing the previous term. For
example, we start the sequence with number 1 and then we pronounce the number
correctly. As for the number 1, It must be read as "one 1," where "one" represents the
total digits of that number. We write the "one 1" numerically and we get the number 11.
Next we can read 11 as "two 1." So the next number of this sequence is 21. We read 21 as
"one 2, one 1". So the next number of this sequence is 1211. Thus the sequence is: 1,11,
21,1211[read as one 1, one 2, two 1],111221,....
You are given a number where the digits are the elements of a numpy array. Write a
method that generates the next number in the look and say sequence and stores it in a new
array.
Constraint: You cannot use any other datatype [i.e. string] or data structure except for
arrays.
Hint: The size of the new array will never be more than 100.
[You need not worry about the extra zeroes at the end of your resulting array]
 Use Python: Look and Say: There is a particular sequence named

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!