Longest Repeat-Free Stretch
Medium · Longest Repeat-Free Stretch
You are given a string `text`. Return the length of its longest contiguous piece in which no character appears more than once. The piece must be contiguous: you cannot skip characters in the middle. Spaces, digits and punctuation count as ordinary characters. For an empty string the answer is 0.…
Solve the problem →