* There are so many substring search problems which could be solved by the sliding window algorithm. * So I sum up the algorithm template here. wish it will help you! * The similar questions are: * ...
// For a balanced substring with one char, any length works (all chars are equal) maxlen = Math.max(maxlen, getLength(s, 'a')); // Consider 'b' and 'c' maxlen = Math ...