input: Write a function to determine the number of common substrings between two given strings. If there are no common substrings, return 0.
  def num_common_substrings(s1, s2):
      count = 0
      for i in range(len(s1)):
          for j in range(min(len(s1[i:]), len(s2))):
              if s1[i:i+j+1] in s2:
                  count += 1
      return count
  
  assert num_common_substrings("abcd", "bae")==2
  assert num_common_substrings("a", "a")==1
  assert num_common_substrings("xyz", "abc")==0
  assert num_common_substrings("", "test")==0
  assert num_common_substrings("test", "")==0
output: def num_common_substrings(s1, s2):
      count = 0
      for i in range(len(s1)):
          for j in range(min(len(s1[i:]), len(s2))):
              if s1[i:i+j+1] in s2:
                  count += 1
      return count