input: Write a python function to find the longest common substring between two given strings.
  assert longest_common_substring("abcdef", "zbcdf") == "bcd"
  assert longest_common_substring("12345", "54321") == "1"
  assert longest_common_substring("hello", "hello") == "hello"
  assert longest_common_substring("abc", "def") == ""
output: def longest_common_substring(s1, s2):
      m = len(s1)
      n = len(s2)
      max_len = 0
      ending_index = m
      length = [[0] * (n + 1) for _ in range(m + 1)]
  
      for i in range(1, m + 1):
          for j in range(1, n + 1):
              if s1[i - 1] == s2[j - 1]:
                  length[i][j] = length[i - 1][j - 1] + 1
                  if length[i][j] > max_len:
                      max_len = length[i][j]
                      ending_index = i
              else:
                  length[i][j] = 0
  
      return s1[ending_index - max_len: ending_index]