input: Write a python function to generate the given pattern.
  assert generate_pattern(3) == "1\n12\n123\n12\n1\n"
  assert generate_pattern(5) == "1\n12\n123\n1234\n12345\n1234\n123\n12\n1\n"
  assert generate_pattern(1) == "1\n"
output: def generate_pattern(n):
      result = []
      for i in range(1, n+1):
          result.append(''.join(str(x) for x in range(1, i+1)))
      for i in range(n-1, 0, -1):
          result.append(''.join(str(x) for x in range(1, i+1)))
      return '\n'.join(result) + '\n'