There was a problem at the Winter 2019 Q# codeforces contest (that is now over), which I cannot find a mathematical solution for.
The problem goes like this: You are given 3 qubits that can be in one of the following states:
$$|ψ_0⟩=\frac{1}{\sqrt 3}\left(|100⟩+ω|010⟩+ω^2|001⟩\right)$$
or
$$|ψ_1⟩=\frac{1}{\sqrt 3}\left(|100⟩+ω^2|010⟩+ω|001⟩\right)$$
where $ω=e^{2iπ/3}$.
Build a function that determines in which of the 2 states are the 3 qubits.
My question is, how could you solve this problem in linear algebra (bra-kets notation) and the normal quantum logic gates? I figured out you have to somehow measure the coefficients, but I don't know quite how. If you could include a "code algorithm proof of concept" that would be great, but I am mainly interested in understanding the algebra part. After understanding it, implementing would be just a problem of translating the operations/gates.
If I got something wrong, please correct me. I am new-ish to the whole quantum computing scene.