input: Write a function to find a substring in a string. If the substring is not found in the string, return -1. If it is found, return the starting index of the substring in the string.
  
  def find_substring(source, substring):
      if substring not in source:
          return -1
      i = 0
      while i < len(source):
          if source[i] == substring[0]:
              flag = True
              for j in range(len(substring)):
                  if substring[j] != source[i + j]:
                      flag = False
                      break
              if flag:
                  return i
          i += 1
      return -1
  
  assert find_substring("hello world", "world") == 6
  assert find_substring("hello world", "hello") == 0
  assert find_substring("hello world", "o w") == 4
  assert find_substring("hello world", "foo") == -1
  assert find_substring("", "foo") == -1
output: def find_substring(source, substring):
      if substring not in source:
          return -1
      i = 0
      while i < len(source):
          if source[i] == substring[0]:
              flag = True
              for j in range(len(substring)):
                  if substring[j] != source[i + j]:
                      flag = False
                      break
              if flag:
                  return i
          i += 1
      return -1