input: Write a python function to print the specified pattern.
  assert print_pattern(3) == """
  * * * 1
  * * 2$2
  * 3$3$3"""
  assert print_pattern(2) == """
  * * 1
  * 2$2"""
  assert print_pattern(1) == """
  * 1"""
output: def print_pattern(n):
      result = []
      for i in range(1, n + 1):
          stars = ' '.join(['*'] * (n - i + 1))
          numbers = '$'.join([str(i)] * i)
          result.append(f"{stars} {numbers}")
      return "\n" + "\n".join(result)