Question: Write a program that reads in a sequence of integers and prints both the integer that appears in a longest consecutive run and the length
Write a program that reads in a sequence of integers and prints both the integer that appears in a longest consecutive run and the length of that run. For example, if the input is 1 2 2 1 5 1 1 7 7 7 7 1 1, then your program should print Longest run: 4 consecutive 7s.
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
This task can be approached in a few simple steps 1 Initialize variables We require four variables T... View full answer
Get step-by-step solutions from verified subject matter experts
