[Tutor] python programmin problem

monikajg at netzero.net monikajg at netzero.net
Wed Jul 20 17:11:09 EDT 2016


Hi:
Can somebody please provide answer to following python programming question? I have spent days on it and cannot come up with any code that would make any sense for it so I cannot provide you any code. But I would appreciate the answer very much, if not in python, then in pseudo code.
Thank you very much
Monika

Here is the problem:
Given a list of integers, return the progress of the test
The progress is defined as the length of the longest run of strictly increasing scores "with gaps allowed".
That is the length of the longest group of numbers such that each number in that block is strictly larger than the previous number, and the group can be formed by choosing some subset of values in the order they appear in the original
list. All values are integers.
input [1,7,2,3,5,4,6] returns 5
[1,2,3,5,6] and [1,2,3,4,6] both have length 5 and are longer than any other runs
Returning 7 is incorrect for [1,2,3,4,5,6,7] as it changes the ordering of the original sequence.
Input [1,2,3,4] the run [1,2,3,4] is the entire test and has lenght 4. returns 4
Input [4, 3, 2, 1] returns 1 each result is a run of 1. so we return 1
Input [1,2,0,4,5] return 5 longest run [1,2,4,5] has lenght 4



____________________________________________________________
Affordable Wireless Plans
Set up is easy. Get online in minutes.
Starting at only $9.95 per month! 
www.netzero.net?refcd=nzmem0216


More information about the Tutor mailing list