Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Write a function that finds the zero-based index of the longest run in a string.
  2. A run is a consecutive sequence of the same character. If there is more than one run with the same length,
  3. return the index of the first one.
  4.  
  5. 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