If several people work collaboratively on a problem, they all get to be authors even if all the ideas that finally led to the solution came from only one of them. That is a perfectly ordinary situation.
The question then reduces to that of whether the situation described comes under the description of "collaborative work". I think that needs more detail to judge and there will always be a grey area.
If what actually happened was that the Alice said to Bobby "Charlotte and I are working on an interesting problem, namely ..." and then Bobby went away and solved it, I would call that a collaboration.
OTOH, if what happened was that Alice said to Bobby "here is a problem for you" without mentioning that Alice & Charlotte were working on it too, then Bobby has a good case for being sole author. Whether Bobby should insist on that right is another question.
In a practical situation I would recommend a somewhat greater degree of generosity towards a student than towards a seasoned researcher.