Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a function that finds the zero-based index of the longest run in a string.
- A run is a consecutive sequence of the same character. If there is more than one run with the same length,
- return the index of the first one.
- For example, IndexOfLongestRun("abbcccddddcccbba") should return 6 as the longest run is dddd and it first appears on index 6.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement