input: Write a python function to build an inverted index from a given file.
  assert build_inverted_index('testfile1.txt') == {'hello': [0], 'world': [6]}
  assert build_inverted_index('testfile2.txt') == {'python': [0], 'code': [7]}
  assert build_inverted_index('testfile3.txt') == {'example': [0], 'text': [8]}
output: def build_inverted_index(filename):
      inverted_index = {}
      with open(filename, 'r') as file:
          content = file.read()
          words = content.split()
          for position, word in enumerate(words):
              if word in inverted_index:
                  inverted_index[word].append(position)
              else:
                  inverted_index[word] = [position]
      return inverted_index