detecting first sequence in an array
<p>given a string say "4 2 5 5 5 1 5 5 5 29 8", I would like to write a function that returns the first repeating longest sequence of numbers. In this case it would return 555. What is the best and most efficient way to do this?</p>

<p>this is not a homework, it's one of the programming challenge that I encountered</p>

<p><strong>UPDATE</strong>
My initial approach is to use the convert this into an array of chars, traverse the array, and use the indexOf to see if there is another number say 5 in this array of chars, if there is then I check the next index of 5 if it is the same.. I hope this makes sense.. but this just doesn't work for the example above</p>
