input: Write a function to print a pattern with stars and numbers.
  assert pattern(3) == "*
  1
  **
  12
  ***
  123
  "
  assert pattern(1) == "*
  1
  "
  assert pattern(4) == "*
  1
  **
  12
  ***
  123
  ****
  1234
  "
output: def pattern(n):
      result = []
      for i in range(1, n + 1):
          result.append('*' * i)
          result.append(''.join(str(x) for x in range(1, i + 1)))
      return '\n'.join(result) + '\n'