Question: python Write a function count_longest that takes a queue of characters as a parameter and returns the length of the longest consecutive subsequence. For example:

python

python Write a function count_longest that takes a queue of characters asa parameter and returns the length of the longest consecutive subsequence. For

Write a function count_longest that takes a queue of characters as a parameter and returns the length of the longest consecutive subsequence. For example:

fix count_longest.py to pass count_longest_test.py

I' 2 3 00 count_longest_test.py 1 # TEST FILE FOR COUNT LONGEST SUBSEQUENCE 2. # DO NOT MODIFY 3 4 from Queue import Queue 5 from count_longest import count_longest| 6 7 def test_count_hello(): 8 assert count_longest( Queue [ 1 for 1 in "hello" ] ) ) == 2 9 10 def test_count_m5(): 11 assert count_longest(Queue ([1 for 1 in "m" * 5])) == 5 12 13 def test_count_03(): 14 assert count_longest(Queue ([1 for 1 in "hooop"])) == 3 15 16 def test_count_04(): assert count_longest(Queue ([1 for 1 in "oooohh"])) == 4 18 def test_count_oe4(): 20 assert count_longest(Queue ([1 for 1 in "oooohheeee"] )) == 4 21 17 19 MI count_longest.py 1 # MODIFY ME TO IMPLEMENT YOUR SOLUTION 2 # TO PROBLEM 4: COUNT THE LONGEST SUBSEQUENCE 3 # 4 # NAME: FIXME # ASSIGNMENT: Technical HW: Stacks & Queues 6 7 def count_longest(9): 8 len = 0 9 5 6 00 10 11 return len 12 E def main(): 13 print("out 2:", count_longest( Queue ([ 1 for 1 in michelle rende 14 print("out 5:", count_longest(Queue ([1 for l in "m". * 51222 15 print("out 3:", count_longest(Queue ([1 for 1 in "heee" 2012 16 17 18 # Don't run main on import 19 if _name_ __main__": 20 | main() 21 22

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!