input: def sierpinski_triangle(n: int): 
      """ Generate the first n elements of the Sierpinski triangle. 
      >>> sierpinski_triangle(1) 
       # Output: 
      >>> sierpinski_triangle(2) 
      1 
      # Output:
      1 1
      1 0
      >>> sierpinski_triangle(3)
      1
      1 1
      1 0 1
      1 1 1 1
      1 0 0 0 1
      1 1 0 0 1 1
      """
output:     if n == 1:
          return [1]
      
      triangle = [[1]]
      for i in range(1, n):
          row = [1]
          for j in range(1, i):
              row.append(triangle[i-1][j-1] ^ triangle[i-1][j])
          row.append(1)
          triangle.append(row)
      
      return [item for sublist in triangle for item in sublist]