A logic problem. No need for calculation
Person $1$ states that he does not see $2$ white hats.
If Person $2$ sees a white hat on Person $3$, then he knows that his hat is black, because there must be at least $1$ black hat between $2$ and $3$.
So Person $2$ must have seen a black hat on Person $3$, leading to his uncertainty.
Initially there are $7$ possibilities:
$$ \begin{array}{|c|c|c|c|} \hline 1 & 2 & 3 \\ \hline B & B & B \\ \hline B & B & W \\ \hline B & W & B \\ \hline B & W & W \\ \hline W & B & B \\ \hline W & B & W \\ \hline W & W & B \\ \hline \hline \end{array} $$
First says that he doesn't know, so one of $2-3$ has a black, that leaves us with:
$$ \begin{array}{|c|c|c|c|} \hline 1 & 2 & 3 \\ \hline B & B & B \\ \hline B & B & W \\ \hline B & W & B \\ \hline W & B & B \\ \hline W & B & W \\ \hline W & W & B \\ \hline \hline \end{array} $$
Second says he doesn't know, that means one of the others has a black, which leaves us with:
$$ \begin{array}{|c|c|c|c|} \hline 1 & 2 & 3 \\ \hline B & B & B \\ \hline B & B & W \\ \hline B & W & B \\ \hline W & B & B \\ \hline W & W & B \\ \hline \hline \end{array} $$
Moreover, the second knows that the first has seen a black among $2$ or $3$ and he sees that $3$ has white in row $2$, so if row two is the case then the second actually does know his color, so row $2$ gets eliminated:
$$ \begin{array}{|c|c|c|c|} \hline 1 & 2 & 3 \\ \hline B & B & B \\ \hline B & W & B \\ \hline W & B & B \\ \hline W & W & B \\ \hline \hline \end{array} $$
The third knows that his color is black, because in all remaining worlds that's the case.
Probably each person can see the hats of the other 2 persons. Let A,B,C denote the 3 persons. A says he doesn't know so B,C don't both wear white hats otherwise he would know that he wears a black one. So B,C wear both black or one black and one white. Same stands for B. So A,C wear both black or one black and one white. So we have the 6 cases of what each of the 3 can be wearing:
A: |x|x|x|B|B|W|
B: |B|B|W|B|W|B|
C: |B|W|B|x|x|x|
So C sees what A,B wear according to the above table (checking the right half of the table). For example if B wears white hat then C wears black hat.
So we obtain the following according to the above observations:
A: | B |B|W|
B: | B |W|B|
C: |B or W|B|B|
But in the first column C cannot wear white since then B by seeing that C wears white and that not both B,C wear white (because A doesn't know what he wears) then he would know that he wears black. So we exclude this possibility and we have:
A: |B|B|W|
B: |B|W|B|
C: |B|B|B|
So C wears a black hat.