The "hint" is the solution. That would be annoying for someone who hadn't figured it out.
One-way functions are very cool and form the basis of public-key cryptography, although it's quite a bit more complicated than this example.
I suppose this is why public-key cryptography was invented ;)
The idea is that the guards aren't malicious, just stupid.