Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 264 Bytes

problem.md

File metadata and controls

14 lines (10 loc) · 264 Bytes

Given a string str, write a function to determine the longest substring containing only two unique characters.

Example:

> uniqueSubstr('eceba')
> 3 // "ece"

> uniqueSubstr('ccaabbb')
> 5 // "aabbb"

> uniqueSubstr('abcabcabc')
> 2 // "ab", "bc", or "ca"