Find the Zebra!
InterviewTime limit0.5sMemory limit1024 MB
Count the runs of 1s in each zebra's coat string, then print the maximum run count and how many zebras reach it.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Statement
A safari tour guest named Geondeok was interested in zebras. He thought a zebra was more beautiful when its body had more black stripes.
Geondeok records the coat of each zebra with 0 and 1. 0 marks a white part of the coat, and 1 marks a black part.
The number of black stripes is the number of consecutive black parts. For example, if Geondeok records a zebra's coat as 01101110101, this zebra has black stripes.
Input
The first line contains the number of zebras and the body length , separated by a space. ()
Each of the next lines contains a string of length that describes one zebra's coat as recorded by Geondeok. Each string consists only of 0 and 1.
Output
Print the number of black stripes of the most beautiful zebra in Geondeok's opinion, and the number of zebras that have that many stripes, separated by a space.