input: Write a function to generate the first n elements of the Sierpinski triangle. The function should return a list of strings where each string represents a row of the triangle with '1' for filled cells and '0' for empty cells. The input parameter n is the number of rows to generate. If n is 0, the function should return an empty list.
  assert sierpinski_triangle(0)==[]
  assert sierpinski_triangle(1)==['1']
  assert sierpinski_triangle(2)==['1', '1 1', '1 0 1']
  assert sierpinski_triangle(3)==['1', '1 1', '1 0 1', '1 1 1 1', '1 0 0 0 1']
  assert sierpinski_triangle(4)==['1', '1 1', '1 0 1', '1 1 1 1', '1 0 0 0 1', '1 1 0 0 1 1', '1 0 1 0 1 0 1']
output: def sierpinski_triangle(n):
      if n == 0:
          return []
      triangle = ['1']
      for i in range(1, n):
          prev_row = triangle[-1]
          new_row = '1'
          for j in range(1, len(prev_row)):
              new_row += ' ' + ('1' if prev_row[j-1] != prev_row[j] else '0')
          new_row += ' 1'
          triangle.append(new_row)
      return triangle