Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sri has a group of vintage string lights with some of the lights defective. A defective light is shown by 0 and a normal (non-defective)

image text in transcribed

Sri has a group of vintage string lights with some of the lights defective. A defective light is shown by 0 and a normal (non-defective) light is shown by 1 in the input. For example, the input "0110" represents a string light with 4 lights with first and the fourth light defective. Sri is interested in finding the longest number of non-defective lights in a row. In the example above, the longest number of non-defective lights is 2, the middle two lights. The first line of input will contain the number of vintage lights followed by the string representation of each and every light. The output should be a single integer denoting the longest chain of non-defective lights. The chain can continue to the next group of lights. For example in test case 1, the longest number of non-defective lights is 5 with 4 lights from first string and 1 light from the second string. LAB ACTIVITY 8.27.1: Programming Assignment 3 Question 3 0/20 U main.py 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

More Books

Students also viewed these Databases questions