input: Write a python function to generate a triangular pattern of numbers as shown in the code.
  assert generate_pattern(5) == [
      "1",
      "2 4",
      "3 6 9",
      "4 8 12 16",
      "5 10 15 20 25"
  ]
  assert generate_pattern(3) == [
      "1",
      "2 4",
      "3 6 9"
  ]
  assert generate_pattern(1) == [
      "1"
  ]
output: def generate_pattern(n):
      result = []
      for i in range(1, n+1):
          line = " ".join(str(i*j) for j in range(1, i+1))
          result.append(line)
      return result