Solution (source code)

= Solution

Because $(n\cdot\sigma)^2=I$, even and odd powers sum separately: $R=I\cos\theta+i(n\cdot\sigma)\sin\theta$. Then $RR^\dagger=I$.