Question
Alice wants to track how regular she is at exercising. On a single line via Standard Input, you're given her exercise record over several
Alice wants to track how regular she is at exercising. On a single line via Standard Input, you're given her exercise record over several days. A Yindicates that she exercised on that day, and an Nindicates that she did not. For example, an input line could look like: YYNYYYNNY A streak is defined as a set of consecutive days when Alice exercised i.e. a set of consecutive s Your task is to find the length of the longest streak in the input, and print that number on a single line to Standard Output. Example Input YYNYYYNNY Output 3
Step by Step Solution
3.55 Rating (165 Votes )
There are 3 Steps involved in it
Step: 1
You can achieve this in Python by reading the exercise record iterating throu...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Introduction To Materials Management
Authors: Arnold J. R. Tony, Gatewood Ann K., M. Clive Lloyd N. Chapman Stephen
8th edition
9386873249, 134156323, 978-9386873248
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App