input: Write a python function to find the longest common substring between two strings.
  assert longest_common_string("I love programming", "I love solving puzzles") == "I love "
  assert longest_common_string("abcdef", "zabcyf") == "abc"
  assert longest_common_string("12345", "54321") == "1"
output: def longest_common_string(s1, s2):
      m, n = len(s1), len(s2)
      longest = 0
      ending_index = 0
      dp = [[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]:
                  dp[i][j] = dp[i - 1][j - 1] + 1
                  if dp[i][j] > longest:
                      longest = dp[i][j]
                      ending_index = i
              else:
                  dp[i][j] = 0
  
      return s1[ending_index - longest: ending_index]