Question: Please use python to solve. Problem 4: count the longest subsequence Write a function count_longest that takes a queue of characters as a parameter and
Please use python to solve.

Problem 4: count the longest subsequence 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: Example call Returns count_longest( Q[h, e, l, l, o] ) 2 count_longest( Q[m, m, m, m, m] ) count_longest( Q[h, e, e, e] ) 3 count_longest( []) 0 Hint: you can destroy the queue & make it empty! Your solution should not use any built-in or library functions other than those in the Stack and Queue classes provided
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
