Checking solution on discriminant of $\mathbb{Q}(\sqrt{-3})$

Solution 1:

$\{1,\sqrt{-3}\}$ is not a $\mathbb Z$-basis for $O_K$ since $x^2+x+1$ has root $w=\frac{-1+\sqrt{-3}}2$. This points to the correct basis $\{1,w\}$ and we get the matrix as $$\begin{bmatrix}1&w\\1&\overline w=w^2\end{bmatrix}$$ with determinant $w^2-w=-2w-1=-\sqrt{-3}$ and square $-3$.