input: Write a function to simplify the given Python code by combining redundant print statements into a single print statement. If the given code is already simplified, it should return unmodified.
  def simplify_code(code: str) -> str:
  
  assert simplify_code("def just_me(name):\n    print(\"Hi, my name is \"+name+\".\")\n    print(\"I am special and nothing else matters.\")\n    print(\"What about you?\")")== "def just_me(name):\n    print(\"Hi, my name is \"+name+\". I am special and nothing else matters.\")\n    print(\"What about you?\")"
  assert simplify_code("def greet(name):\n    print(\"Hello, \"+name+\"!\")\n    print(\"Nice to meet you.\")")== "def greet(name):\n    print(\"Hello, \"+name+\"!\")\n    print(\"Nice to meet you.\")"
  assert simplify_code("")== ""
  assert simplify_code("def say_hi(name):\n    output = \"Hi, \"+name+\"!\"; print(output)")== "def say_hi(name):\n    output = \"Hi, \"+name+\"!\"; print(output)"
output: def simplify_code(code: str) -> str:
      import re
      lines = code.split('\n')
      new_lines = []
      i = 0
      while i < len(lines):
          if re.match(r'\s*print\(', lines[i]):
              combined = lines[i]
              while i + 1 < len(lines) and re.match(r'\s*print\(', lines[i + 1]):
                  combined += ' ' + lines[i + 1].split('(', 1)[1].rsplit(')', 1)[0]
                  i += 1
              new_lines.append(f"print({combined.split('(', 1)[1].rsplit(')', 1)[0]})")
          else:
              new_lines.append(lines[i])
          i += 1
      return '\n'.join(new_lines)