Hmm, tough one!
K, this is how I went about it.
There are 7 different ways the hats can be arranged:
1 2 3 4 5 6 7
W W W B B B W -> Prisoner A (Pa)
W W B B W W B -> Prisoner B (Pb)
W B B W W B W -> Prisoner C (Pc)
----------------------
B W W W W W W -> Unrevealed
B B W W B W B -> Unrevealed
Row 7 is what we have been given.
The only instance Pc can answer correctly is if both Pa and Pb were wearing black hats (row 4). Becuase there are only 2 black hats, Pc would have known that he must be wearing a white hat then. So, that eliminates row 4.
Because Pc did not answered immediately, Pa and Pb now know that they can't both be wearing black hats.
Now, if rows 5 or 6 were true, then Pb would know that he is wearing a white hat, because if he was wearing a black hat, Pc would have seen this and popped the answer. Since neither Pb or Pc pop the answer, Pa has deducted that rows 5 and 6 are false.
This eliminates rows 4,5 and 6.
Of the remaining rows, only Pa keeps the same colour hat - which is white.
Prisoner A pops the answer and they all walk free!