output_description: Print an index of T where P found in a line. Print the indices in ascending
  order.
input_description: In the first line, a text T is given. In the second line, a string P is given.
attempt: def create_skip_table(pattern):
      table = [0 for i in range(len(pattern))]
      j = 0
      for i in range(1, len(pattern)):
          if pattern[i] == pattern[j]:
              table[i] = j
              j += 1
          else:
              table[i] = j
              j = 0
      return table
  
  
  def kmp_search(text, pattern):
      skip_table = create_skip_table(pattern)
      ti, pi = 0, 0
      while ti < len(text):
          # print(text)
          # print(' '*(ti-pi) + pattern)
          # print(' '*ti + '^')
  
          if text[ti] == pattern[pi]:
              ti += 1
              pi += 1
          elif pi == 0:
              ti += 1
          else:
              pi = skip_table[pi]
          if pi == len(pattern):
              print(ti - pi)
              pi = 0
              ti -= len(pattern) - 1
  
  
  text = input()
  pattern = input()
  
  kmp_search(text, pattern)
  
problem_description: String Search
  
  Find places where a string P is found within a text T. Print all indices of T
  where P found. The indices of T start with 0.
samples: [{"input": "aabaaa\n    aa", "output": "0\n    3\n    4"}, {"input": "xyzz\n    yz", "output": "1"}, {"input": "abc\n    xyz", "output": "The output should be empty."}]