input: Write a python function to find the longest common substring between two given strings.
  assert longest_common_substring("geeksforbridge", "bridgelabz") == "bridge"
  assert longest_common_substring("abcdefg", "xyzabc") == "abc"
  assert longest_common_substring("12345", "54321") == "1"
  assert longest_common_substring("hello", "world") == "o"
  assert longest_common_substring("abcdxyz", "xyzabcd") == "abcd"
output: def longest_common_substring(str1, str2):
      m, n = len(str1), len(str2)
      max_len = 0
      end_index = 0
      lcsuff = [[0 for k in range(n+1)] for l in range(m+1)]
      
      for i in range(1, m+1):
          for j in range(1, n+1):
              if str1[i-1] == str2[j-1]:
                  lcsuff[i][j] = lcsuff[i-1][j-1] + 1
                  if lcsuff[i][j] > max_len:
                      max_len = lcsuff[i][j]
                      end_index = i
              else:
                  lcsuff[i][j] = 0
                  
      return str1[end_index-max_len:end_index]