input: Write a function to add a positive feedback loop to a given Python program's for loop. The function should modify the loop to print an additional message "You've got it!" when the loop completes. If the input loop is valid, return the modified loop as a string. If the input is not a valid for loop or is empty, return "Invalid input".
  
  assert add_positive_feedback("for i in range(10):\n    print(\"hello\")") == "for i in range(10):\n    print(\"hello\")\n    i += 1\n    if i == 10:\n        print(\"You've got it!\")"
  assert add_positive_feedback("for i in range(5):\n    print(\"hi\")") == "for i in range(5):\n    print(\"hi\")\n    i += 1\n    if i == 5:\n        print(\"You've got it!\")"
  assert add_positive_feedback("for i in range(3):\n    print(\"hey\")") == "for i in range(3):\n    print(\"hey\")\n    i += 1\n    if i == 3:\n        print(\"You've got it!\")"
  assert add_positive_feedback("") == "Invalid input"
  assert add_positive_feedback("while True:\n    print(\"infinite loop\")") == "Invalid input"
output: def add_positive_feedback(loop_str):
      if not loop_str or not loop_str.strip().startswith("for"):
          return "Invalid input"
      lines = loop_str.split("\n")
      loop_line = lines[0]
      range_end = int(loop_line.split("range(")[1].split(")")[0])
      lines.append(f"    i += 1")
      lines.append(f"    if i == {range_end}:\n        print(\"You've got it!\")")
      return "\n".join(lines)