// 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 ...
Understand what the interviewer is asking for by using test cases and questions about the problem. Established a set (2-3) of test cases to verify their own solution later. Established a set (1-2) of ...