Skip to content

CGreenP/NPTEL-Introduction-to-Programming-in-C-Assignment-6-Question-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

NPTEL-Introduction-to-Programming-in-C-Assignment-6-Question-2

NPTEL Introduction to Programming in C Assignment 6 Question 2

Question 2

In a string, a "run" is a substring with consisting of consecutive occurrences of the same character. For example, the string "mississippi" contains the following runs - "ss", "ss" and "pp".

In this question, given a string, you have to output the length of the longest run in the string.

Input

A string, having length at most 100. The string is guaranteed to have at least one run.

Output

The length of the longest run in the string.

Sample Input

abbaaacccc

Sample Output

4

Sample Input 1

pqrsssspppqqppttttt

Sample Output 1

5

Sample Input 2

pprdfgeerjimcndddgeejkcjjdjsssssrrtthsa

Sample Output 2

5

Sample Input 3

ppqqqyrtgfdreeennnnnnssggrrjfhg

Sample Output 3

6

Releases

No releases published

Packages

No packages published

Languages