length of substring will be rightIndex - leftIndex + 1. Compare this with the maximum length and return maximum length
maxlen = max ( maxlen , r - l + 1 ) NEW_LINE r += 1 NEW_LINE return maxlen NEW_LINE