Skip to content

Instantly share code, notes, and snippets.

@asadali3210
Created May 31, 2017 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asadali3210/2da71f8139fbcf7352bfc6e683c5d650 to your computer and use it in GitHub Desktop.
Save asadali3210/2da71f8139fbcf7352bfc6e683c5d650 to your computer and use it in GitHub Desktop.
Given an array of characters, write a function that finds the count of the longest consecutive repeated characters.
Input: Array of Characters
Output: Integer
Examples:
Input = [a,b,c,f,f,f,f,d,d,r,r,r,s,z]
Output = 4
(because character ‘f’ is repeated 4 times)
Input = [r,t,j,j,l,m,n,n,j,k]
Output = 2
(because both characters ‘j’ and ‘n’ are repeated 2 times)
Instructions:
- You can choose any programming language.
- Don't use any built-in functions in any language. Just write your own algorithm and functions as needed.
- Don’t do search on Google for the answers. Please do the answer based on your best knowledge.
- Please do all of your answers in the provided answer field. Use of any other text editor is not allowed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment