The problem with hard problems is that its easy to give up. However, just because you gave up doesn't mean you didn't learn anything. Especially beginners write a lot of crap code and it's actually better if that code never makes it to production but when its time for their second or third project their previous experience becomes very valuable.