Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended 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

More Books

Students also viewed these Programming questions

Question

What is a hybrid strategy? Why is it used?

Answered: 1 week ago