input: Write a function that takes two strings as arguments and returns the longest common substring between them. If there are multiple substrings with the same maximum length, return any one of them. If there is no common substring, return an empty string.
  
  assert longest_substring("abcdabcdabde", "defabcdabcd")=="abcdabcd"
  assert longest_substring("abcdef", "ghijkl")==""
  assert longest_substring("hello", "worldhol")=="hol"
  assert longest_substring("python", "javascript")=""
  assert longest_substring("","")==""
output: def longest_substring(str1, str2):
      m, n = len(str1), len(str2)
      dp = [[0] * (n + 1) for _ in range(m + 1)]
      max_len = 0
      end_index = 0
      
      for i in range(1, m + 1):
          for j in range(1, n + 1):
              if str1[i - 1] == str2[j - 1]:
                  dp[i][j] = dp[i - 1][j - 1] + 1
                  if dp[i][j] > max_len:
                      max_len = dp[i][j]
                      end_index = i
      
      return str1[end_index - max_len:end_index]