input: Write a function to find the longest substring with repeated characters.
  assert findLongestSubstring('abcdabca') == 'a'
  assert findLongestSubstring('bbbbb') == 'bbbbb'
  assert findLongestSubstring('abcde') == 'a'
  assert findLongestSubstring('aabbccdd') == 'aa'
  assert findLongestSubstring('aabbaabbaabb') == 'aa'
output: def findLongestSubstring(s):
      if not s:
          return ""
      
      max_len = 0
      max_substr = ""
      current_char = s[0]
      current_len = 1
      
      for i in range(1, len(s)):
          if s[i] == current_char:
              current_len += 1
          else:
              if current_len > max_len:
                  max_len = current_len
                  max_substr = s[i - current_len:i]
              current_char = s[i]
              current_len = 1
      
      if current_len > max_len:
          max_substr = s[-current_len:]
      
      return max_substr