Question: Write a function: def solution ( A ) that, given an array A of N integers, returns the length of the longest consistent fragment of
Write a function:
def solutionA
that, given an array A of N integers, returns the length of the longest consistent fragment of A in which all elements can be generated using at most two different digits. You must use the same digits for all elements.
Examples:
Given A the function should return Elements and can be generated using only digits and
Given A the function should return The last two elements can be generated using only digit
Given A the function should return
Assume that:
N is an integer within the range ;
each element of array A is an integer within the range
In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.
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
