code: def longest_common_prefix(strs):
      n = len(strs)
      if n == 0:
          return ""
  
      lcp = strs[0]
      # instead of string manipulations, manipulate with the last common index
      lcp_idx = len(lcp)
  
      for i in range(1, n):
          lcp_idx = min(lcp_idx, len(strs[i]))
  
          for j in range(lcp_idx):
              if lcp[j] != strs[i][j]:
                  lcp_idx = j
                  break
  
      return lcp[:lcp_idx]
      """
      # if you like string manipulations, you can use this code
      # i don't like string manipulations in Python because they're immutable
      lcp = strs[0]
      for i in range(1, n):
          lcp = lcp[:len(strs[i])]
          for j in range(len(lcp)):
              if lcp[j] != strs[i][j]:
                  lcp = lcp[:j]
                  break
      return lcp
      """
  
label_desc: Use image node_id 1 for calling a global function with example usage: longest_common_prefix(strs) and returns: lcp, str