-
-
Save asadali3210/2da71f8139fbcf7352bfc6e683c5d650 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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