parameters: (self, s, k)
return_statement: return longestSubstringHelper(s, k, 0, len(s))
docstring: :type s: str
          :type k: int
          :rtype: int
docstring_summary: :type s: str
          :type k: int
          :rtype: int
docstring_tokens: : type s : str : type k : int : rtype : int
function: def longestSubstring(self, s, k):
          """
          :type s: str
          :type k: int
          :rtype: int
          """
          def longestSubstringHelper(s, k, start, end):
              count = [0] * 26
              for i in xrange(start, end):
                  count[ord(s[i]) - ord('a')] += 1
              max_len = 0
              i = start
              while i < end:
                  while i < end and count[ord(s[i]) - ord('a')] < k:
                      i += 1
                  j = i
                  while j < end and count[ord(s[j]) - ord('a')] >= k:
                      j += 1
  
                  if i == start and j == end:
                      return end - start
  
                  max_len = max(max_len, longestSubstringHelper(s, k, i, j))
                  i = j
              return max_len
  
          return longestSubstringHelper(s, k, 0, len(s))
function_tokens: def longestSubstring ( self , s , k ) : def longestSubstringHelper ( s , k , start , end ) : count = [ 0 ] * 26 for i in xrange ( start , end ) : count [ ord ( s [ i ] ) - ord ( 'a' ) ] += 1 max_len = 0 i = start while i < end : while i < end and count [ ord ( s [ i ] ) - ord ( 'a' ) ] < k : i += 1 j = i while j < end and count [ ord ( s [ j ] ) - ord ( 'a' ) ] >= k : j += 1 if i == start and j == end : return end - start max_len = max ( max_len , longestSubstringHelper ( s , k , i , j ) ) i = j return max_len return longestSubstringHelper ( s , k , 0 , len ( s ) )