Longest Substring Of Two Unique Characters
June 11, 2013
Today’s exercise comes from our unending list of interview questions:
Find the longest run of consecutive characters in a string that contains only two unique characters; if there is a tie, return the rightmost. For instance, given input string
abcabcabcbcbc, the longest run of two characters is the 6-character run of
bcbcbcthat ends the string.
Pages: 1 2