input: 
  def sierpinski_triangle(n):
      """ Generate the first n elements of the Sierpinski triangle.
      >>> sierpinski_triangle(6)
      '1 1 0 1 1 0 0 1 1 0 1'
      """
output:     if n <= 0:
          return ""
      
      triangle = ["1"]
      for i in range(1, n):
          new_row = []
          for j in range(len(triangle[i-1]) + 1):
              if j == 0 or j == len(triangle[i-1]):
                  new_row.append("1")
              else:
                  if triangle[i-1][j-1] == triangle[i-1][j]:
                      new_row.append("0")
                  else:
                      new_row.append("1")
          triangle.append("".join(new_row))
      
      return " ".join(triangle)