code: def length_of_longest_substring(s):
      unique_chars = set()
      max_length = 0
      left = 0
      n = len(s)
  
      for i in range(n):
          while s[i] in unique_chars:
              # remove till the current char is unique
              unique_chars.remove(s[left])
              left += 1
  
          # in this moment you're sure that the current char is unique
          unique_chars.add(s[i])
          max_length = max(max_length, i - left + 1)
  
      return max_length
  
label_desc: Use image node_id 1 for calling a global function with example usage: length_of_longest_substring(s) and returns: max_length