input: Write a python function to print a pattern of stars and hashes based on the given number of rows.
  assert pattern(1) == "* \r"
  assert pattern(2) == "* \r* # \r"
  assert pattern(3) == "* \r* # \r* # * \r"
  assert pattern(4) == "* \r* # \r* # * \r* # * # \r"
output: def pattern(n):
      result = ""
      for i in range(1, n+1):
          result += "* " + "# * " * (i-1) + "\r"
      return result