Longest run of identical consecutive items

0
Remix

Given a sequence, such as a string or the list of shows a user watched in order, return the longest run of the same item repeated back to back: its length and the item (and its position if asked). Handle ties and the empty input, in one pass.

NetflixTechnical phone screenLast asked Jul 2026
No answer yet. Write the first one; the best answer gets endorsed.