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 and then we pronounce the number
correctly. As for the number It must be read as "one where "one" represents the
total digits of that number. We write the "one numerically and we get the number
Next we can read as "two So the next number of this sequence is We read as
"one one So the next number of this sequence is Thus the sequence is:
read as one one two
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 ie string or data structure except for
arrays.
Hint: The size of the new array will never be more than
You need not worry about the extra zeroes at the end of your resulting array
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
