And so what? He did some work, he came up against a problem. He's looking for help
with a small part of his homework.
The usual response to homework problems is "show us what you've tried so far" - this guy has.
We've all been young programmers once, banging our head against a seemingly intractable problem that a more experienced programmer would solve with a glance.
We should respect his efforts, and give him hints that would help him with his problem - he didn't ask us to do his whole homework for him.