input: Write a function to generate the first n elements of the Sierpinski triangle. The input to the function will be the integer n, and the output should be the first n elements of the Sierpinski triangle.
  assert sierpinski_triangle(6)==['1', '1 1', '1 0 1', '1 1 1 1', '1 0 0 0 1', '1 1 0 0 1 1']
output: def sierpinski_triangle(n):
      if n == 0:
          return []
      result = ['1']
      for i in range(1, n):
          prev_row = result[-1]
          new_row = '1'
          for j in range(1, len(prev_row)):
              new_row += '0' if prev_row[j-1] == prev_row[j] else '1'
          new_row += '1'
          result.append(new_row)
      return result