Solution (source code)

= Solution

Use <three-way qutrit sign-flip discrimination>. Prepare the <qutrit> in the <uniform superposition state>
$$
|s\rangle=\frac{|0\rangle+|1\rangle+|2\rangle}{\sqrt3}.
$$
For an unknown label $j\in\{0,1,2\}$, the supplied <unitary operator> is $U_j=I-2|j\rangle\langle j|$. Apply it once and then apply the known <inversion about the mean>
$$
D=2|s\rangle\langle s|-I
=\frac13\begin{pmatrix}-1&2&2\\2&-1&2\\2&2&-1\end{pmatrix}.
$$
Since $D^\dagger=D$ and $D^2=I$, this is an allowed <unitary transformation>. Using $\langle s|j\rangle=1/\sqrt3$ gives
$$
DU_j|s\rangle
=D\left(|s\rangle-\frac2{\sqrt3}|j\rangle\right)
=-\frac13|s\rangle+\frac2{\sqrt3}|j\rangle
=\frac{5|j\rangle-\sum_{k\ne j}|k\rangle}{3\sqrt3}.
$$
Perform a <computational-basis measurement> and guess that its outcome is the unknown label. The <Born rule> gives
$$
\boxed{\Pr(\text{correct}\mid U_j)=\left|\frac5{3\sqrt3}\right|^2=\frac{25}{27}.}
$$
Each incorrect outcome has <probability> $1/27$, verifying normalization. The success <probability> is $25/27$ separately for every label, so no assumption about their prior <probabilities> is needed.