Deductive reasoning is about finding answers to a tricky problem with clues that don’t appear to make sense but once you find them, you think they do actually make sense. Solving the problem in your head and explaining it to another person how you did it are two different things. To make this simpler to understand let me use some names for the 3 geniuses. The first genius inline is called ‘A’, then the middle one is called ‘B’ and the last in line is called ‘C’. Drawing the mental picture of the 3 geniuses standing helps to simply the problem.
In my mind they look something like this:These triangles are sized in a way that tells that C is bigger and hence can see which hat A and B are wearing, while B is smaller than C but bigger than A meaning that B can only see which hat A is wearing. Now when C answers that he does not know which hat he wearing, he means that by looking at the A and B, he cannot deduce which hat he could be wearing. Had both A and B been wearing white hats, there would be no hats in the basket left, thus C would have deduced that he was wearing a red hat.
However that not being the case, either A or B are wearing a red hat or both wearing a red hat. Thus only 3 cases can be built upon this. This is how I thought of it. Now when B answers that he does not know, it means that after hearing the response from C and seeing the hat of A, he cannot deduce which color his own hat is. Had A been wearing a white hat, B would have answered that he was wearing a red hat as in case 1. However A was wearing a red hat leaving B unsure what hat he was wearing since case 2 or case 3 could have been applied.